Re: Last visitors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
john@xxxxxxxxxxxx

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux