Re: I'm less experienced please be gentle :)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What does it do? Does it give a specific error? I don't see anything wrong 
with it. If it's not giving an error, perhaps it's returning unexpected 
results? 

This change may give you some insight: 

change: 
if(@mysql_num_rows(mysql_query($banned)) > 0) {

to:

$result = mysql_query($banned) or die (mysql_error());
if (mysql_num_rows($result) > 0) {

--- 

This will give you some mysql errors if that's where the problem lies. 
HTH
-Micah 

On Thursday 18 November 2004 11:14 am, ed@xxxxxxxxxxxx wrote:
> Can anyone tell me whats wrong with the below code? it doesnt execute.
>
> $ip=$_SERVER["REMOTE_ADDR"];
>
> $banned="SELECT * FROM banned WHERE ip='$ip'";
>
> if(@mysql_num_rows(mysql_query($banned)) > 0) {
>
> echo "You have been Banned.";
>
> }else{
> echo "$ip";
> }

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux