Re: Inserting the clients IP into a table

From: Date: Wed, 27 Dec 2000 00:19:17 +0000
Subject: Re: Inserting the clients IP into a table
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-5440@lists.php.net to get a copy of this message
What doesn't work? From a glance, you left out the quotes; you should use $ip = getenv ("REMOTE_ADDR"); Or just use mysql_query("UPDATE phpDownloads SET iphit = $REMOTE_ADDR WHERE DownloadID = $did"); Siggy ----- Original Message ----- From: "Mattias Johansson" <smart@smartsmartsmart.com> To: <php-db@lists.php.net> Sent: Wednesday, December 27, 2000 1:00 PM 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 (#5440) next »