Ryan A wrote:
<snip>
then from my php script (test_last_visitors.php) I ran this test SQL:
$SQL = "UPDATE test_last_visitors SET profile_id=".$profile_id.",
user_id=user_id+1,
ttimestamp=now() WHERE profile_id=1 ORDER BY ttimestamp ASC LIMIT 1";

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...


UPDATE `test_last_visitors` SET `user_id`=$user_id,
`ttimestamp`=now() WHERE `profile_id`=$profile_id ORDER BY `ttimestamp` ASC LIMIT 1


--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to