Re: Last visitors

From: Date: Wed, 20 Apr 2005 17:00:42 +0000
Subject: Re: Last visitors
Groups: php.general 
Request: Send a blank email to php-general+get-213517@lists.php.net to get a copy of this message
Hey, > Why are you setting the profile_id equal to a value when you also have > that in your WHERE clause? I may have missed something here, but I > though the purpose of this was to track the last ten visitors to a > certain page, and if this is the case, why increment the user_id when > updating the row? Shouldn't the query be more like... I was just playing with the SQL....instead of entering new user_id's for each person visiting i just tried increment it... > UPDATE test_last_visitors SET > user_id=$user_id, > ttimestamp=now() WHERE profile_idXúúáDœR#§CÀ > Íì¢=$profile_id ORDER BY ttimestamp > ASC LIMIT 1 I ran the above in phpmyadmin like so: UPDATE test_last_visitors SET user_id=7, ttimestamp=now() WHERE profile_id=2 ORDER BY ttimestamp ASC LIMIT 1 its only updateing the top first record :-( I'm just about to throw in the towel... Thanks, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.16 - Release Date: 4/18/2005

« previous php.general (#213517) next »