Page 1 of 1

Auto Add BOT IP to Table

Posted: Sat Feb 18, 2012 12:13 pm
by phphelpme
Hello fellow coders,


Best wishes

Re: Auto Add BOT IP to Table

Posted: Sun Feb 19, 2012 3:51 pm
by social_experiment
I think the problem could be where you use count(); From the php manual
If var is not an array or an object with implemented Countable interface, 1 will be returned. There is one exception, if var is NULL, 0 will be returned.

Code: Select all

$ipresult = mysql_query($ipquery) or die(mysql_error());
This returns a resource which is not what count() accepts; it doesn't give an error but returns 1 instead which is why you are getting 1 each time.

Hth

Re: Auto Add BOT IP to Table

Posted: Sun Feb 19, 2012 5:34 pm
by phphelpme
Thanks social_experiment for getting back to me. So basically I just need to set up a variable outside the while loop then increment by 1 inside the loop.

Thanks for your assistance.

Best wishes