Re: Getting totals
| From: | Rob W. | Date: | Tue, 06 Jun 2006 18:28:49 +0000 |
| Subject: | Re: Getting totals | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237486@lists.php.net to get a copy of this message | ||
Acutall no, Because in my database is is all them blocks but each ip in all them blocks has a seperate entry in a column. So in listing the whole column in my mysql request, i need a line that will weed out and count how many ip's are in a block.
----- Original Message ----- From: <replies-lists-php@listmail.innovate.net>
To: "Rob W." <rob@fiberuplink.com>
Sent: Tuesday, June 06, 2006 1:16 PM
Subject: Re: [PHP] Getting totals
i may be missing something in your description, but does turning the first and last ipnumber in a block into its integer representation, and then doing the math (subtraction) to get the ipnumber count per block, accomplish what you're after? - Rick ------------ Original Message ------------Date: Tuesday, June 06, 2006 12:15:27 PM -0500 From: "Rob W." <rob@fiberuplink.com> To: php-general@lists.php.net Subject: [PHP] Getting totals Ok, Here is my next problem. Inside my database, I have a list of ip's of about 10 blocks 192.168.100.0 all the way though 255 along with 192.168.101.0 though 255 and 192.168.102.0 though 255 and soforth My problem is, is i'm trying to figure out a pattern to match so I can count how many ip's are in each block and display them. So far what I have gotten is a stristr match but it's not working correctly. I have a variable that basically weed's out the last digits of the ip it's self from help previously So my code so far is: if (stristr($block,$address)) { $count_ip++; } $block would == 192.168.100 $address would == 192.168.100.0 - 255 Any help would be appricated.---------- End Original Message ----------