RE: [PHP] Trying to put ips into database

From: Date: Fri, 08 Feb 2002 21:30:04 +0000
Subject: RE: [PHP] Trying to put ips into database
Groups: php.general 
Request: Send a blank email to php-general+get-84055@lists.php.net to get a copy of this message
What type of field is 'ip'? Matthew Walker Ecommerce Project Manager Mountain Top Herbs -----Original Message----- From: Leif K-Brooks [mailto:eurleif@buyer-brokerage.com] Sent: Friday, February 08, 2002 9:18 AM To: php-general@lists.php.net Subject: [PHP] Trying to put ips into database 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? --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.323 / Virus Database: 180 - Release Date: 2/8/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.323 / Virus Database: 180 - Release Date: 2/8/2002

« previous php.general (#84055) next »