Re: [PHP] Getting totals

2006-06-07 Thread Rafael
uot;$inc"; That returns nothing. What am i still doing wrong? - Original Message - From: "Rabin Vincent" <[EMAIL PROTECTED]> To: "Rob W." <[EMAIL PROTECTED]> Cc: Sent: Tuesday, June 06, 2006 1:36 PM Subject: Re: [PHP] Getting totals On 6/6/06, R

Re: [PHP] Getting totals

2006-06-07 Thread Rabin Vincent
On 6/7/06, Rob W. <[EMAIL PROTECTED]> wrote: Yeah, it counts how many times block is in $address, so if there's 254 ip's listed in the database, it will incriment it 254 times and display that. Well, the code snippet you've shown does NOT do any kind of checking to see if $block is in $address.

Re: [PHP] Getting totals

2006-06-07 Thread Rob W.
; Cc: Sent: Wednesday, June 07, 2006 2:03 AM Subject: Re: [PHP] Getting totals On 6/7/06, Rob W. <[EMAIL PROTECTED]> wrote: I got the fix, strstr didnt work right because it was relaying more than just what I was thinking. Here is the fix. $value=array(strstr

Re: [PHP] Getting totals

2006-06-07 Thread Rabin Vincent
On 6/7/06, Rob W. <[EMAIL PROTECTED]> wrote: I got the fix, strstr didnt work right because it was relaying more than just what I was thinking. Here is the fix. $value=array(strstr($block, $address)); foreach ($value as $var) { $block_total_ip++; } How can this work? $value

Re: [PHP] Getting totals

2006-06-06 Thread Rob W.
OTECTED]> To: "Rob W." <[EMAIL PROTECTED]> Cc: Sent: Tuesday, June 06, 2006 11:38 PM Subject: Re: [PHP] Getting totals On 6/7/06, Rob W. <[EMAIL PROTECTED]> wrote: Sorry for the miss understanding, That's the way the viarable will look, i'm putting i

Re: [PHP] Getting totals

2006-06-06 Thread Rabin Vincent
On 6/7/06, Rob W. <[EMAIL PROTECTED]> wrote: Sorry for the miss understanding, That's the way the viarable will look, i'm putting it in as a viariable. if (strstr($block,$address)) { $inc++; } Like I said before, strstr's argument list is haystack (what to search in) first and then needle (

Re: [PHP] Getting totals

2006-06-06 Thread Paul Novitski
At 06:46 PM 6/6/2006, Rob W. wrote: if (strstr(192.168.100,192.168.100.10)) { $inc++; } echo "$inc"; That returns nothing. What am i still doing wrong? I would use quotation marks to explicitly type these as strings: strstr("192.168.100","192.168.100.10") Paul -- PHP General Mai

Re: [PHP] Getting totals

2006-06-06 Thread Rob W.
]> Sent: Tuesday, June 06, 2006 8:58 PM Subject: Re: [PHP] Getting totals Put quotes or apostrophes on the strings... if (strstr('192.168.100','192.168.100.10')) { On Tue, June 6, 2006 8:46 pm, Rob W. wrote: if (strstr(192.168.100,192.168.100.10)) { $inc++; } e

Re: [PHP] Getting totals

2006-06-06 Thread Rob W.
if (strstr(192.168.100,192.168.100.10)) { $inc++; } echo "$inc"; That returns nothing. What am i still doing wrong? - Original Message - From: "Rabin Vincent" <[EMAIL PROTECTED]> To: "Rob W." <[EMAIL PROTECTED]> Cc: Sent: Tuesday, June 0

Re: [PHP] Getting totals

2006-06-06 Thread Richard Lynch
On Tue, June 6, 2006 12:15 pm, Rob W. wrote: > Ok, Here is my next problem. > > Inside my database, I have a list of ip's of about 10 blocks Some databases, such as PostgreSQL, have native data format of IP and functions to deal with them... I don't suppose you are using one of those? :-) > 192.

Re: [PHP] Getting totals

2006-06-06 Thread Rabin Vincent
On 6/6/06, Rob W. <[EMAIL PROTECTED]> wrote: 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++;

Re: [PHP] Getting totals

2006-06-06 Thread Rob W.
t;[EMAIL PROTECTED]> To: "Rob W." <[EMAIL PROTECTED]> 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 th

Re: [PHP] Getting totals

2006-06-06 Thread Jochem Maas
without actually thinking about your problem I guess that these funcs (the first is most like useful, the second show [at least] how the first can be used and the last func is just for fun) might help you somehow (apologies if If I'm way off base): ALSO: if anyone has a cleaner/faster/better way o