You are here: Re: [PHP] Last visitors « PHP « IT news, forums, messages
Re: [PHP] Last visitors

Posted by John Nichel on 04/20/05 19:08

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@kegworks.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация