Trying to put ips into database
| From: | Leif K-Brooks | Date: | Fri, 08 Feb 2002 16:18:03 +0000 |
| Subject: | Trying to put ips into database | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-84007@lists.php.net to get a copy of this message | ||
I'm trying:
$query = mysql_query("select COUNT(*) as rowexists from ips where ip =
'$REMOTE_ADDR'");
$result = mysql_fetch_array($query);
if($result['rowexists'] == false){
mysql_query("INSERT INTO
ips (ip) VALUES
('$REMOTE_ADDR')");
}
But it keeps putting the ip into tthe array, even if it's already there, and
it only gets the first section of the ip! What am I doing wrong?