Nikolas Galanis wrote:

and with this I intend to retrieve the 10 latest additions of translations. However, when running the script, I noticed that always, on the top of the results was the translation link I had clicked last. And this happens all the time. Now that I think of it again, the clicked link contains a mysql query which increments the translation views by one. Hmmmm.....maybe this does the unwanted update....

Any change to the record will update the timestamp; what you probably want is a seperate counting table for views instead;

PoemViews (
poemid smallint unsigned not null primary key,
count smallint unsigned not null default 0
);

... Then do a "REPLACE INTO PoemViews (poemid, count) SELECT 14, count FROM PoemViews WHERE poemid = 14" ... or whatever (where 14 is an arbitrary number in this case; I'd use a server-side variable, personally).

You could also make a views table thats more universal to the site (which is what I do) and then point to it from your poems table (ViewsID type thing) ... your choice.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Reply via email to