Re: Inserting the clients IP into a table

From: Date: Wed, 27 Dec 2000 02:32:16 +0000
Subject: Re: Inserting the clients IP into a table
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-5441@lists.php.net to get a copy of this message
perhaps you could do this set the iphit column to be unique. do an insert, and if the ipaddy already exists, no records will be inserted, and return result will not be true. dreamvale ----- Original Message ----- From: "Mattias Johansson" <smart@smartsmartsmart.com> To: <php-db@lists.php.net> Sent: Wednesday, December 27, 2000 8:00 AM Subject: [PHP-DB] Inserting the clients IP into a table > Dear group - fast question from a newbie: > > How do I insert the IP of the client into a MySQL database? This is going to > be used for a do-not-vote-twice mechanism) The IP shall overwrite the cell > if there is any info... I try to use this code, but it does not seem to > work: > > $ipaddy=getenv(REMOTE_ADDR); > mysql_query("UPDATE phpDownloads SET iphit = $ipaddy WHERE DownloadID = > $did"); > > Please help - I'm very stuck. > /Mattias > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#5441) next »