Re: Last visitors
| From: | John Nichel | Date: | Wed, 20 Apr 2005 16:08:36 +0000 |
| Subject: | Re: Last visitors | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-213516@lists.php.net to get a copy of this message | ||
Ryan A wrote:
<snip>
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... UPDATEthen 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";
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
john@kegworks.com