Not sure what your exact problem is but I did notice you had back ticks(`)
in your insert statement.  You should be using (').   You may need a where
clause in your insrt statement unless you want to populate all rows.  Just a
couple of thoughts.


----- Original Message -----
From: "Leif K-Brooks" <[EMAIL PROTECTED]>
Sent: Friday, February 08, 2002 11:18 AM
Subject: [PHP] Trying to put ips into database

> I'm trying:
> $query = mysql_query("select COUNT(*) as rowexists from ips where ip =
> $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,
> it only gets the first section of the ip!  What am I doing wrong?

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to