RE: [PHP-DB] I'm less experienced please be gentle :)
| From: | Norland, Martin | Date: | Thu, 18 Nov 2004 19:40:24 +0000 |
| Subject: | RE: [PHP-DB] I'm less experienced please be gentle :) | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-37347@lists.php.net to get a copy of this message | ||
Remove the @ in front of the mysql_num_rows function call. The @ symbol
supresses errors, so that's likely where your error would be printed.
Cheers
- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.
-----Original Message-----
From: ed@legend.co.uk [mailto:ed@legend.co.uk]
Sent: Thursday, November 18, 2004 1:15 PM
To: php-db@lists.php.net
Subject: [PHP-DB] I'm less experienced please be gentle :)
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";
}