i read kevin's book (1st edition)... and i liked the idea that by adding a column in my MySQL table i can know how many ppl read the articles on the site. so i copied the code below:
this just the job very well, but has one problem. i also have a 'posted' column which timestamps the time the article was written... but every time a user views the article...the posted column is updated. what can i do...so it doesnt get updated?
$viewed = @mysql_query("UPDATE news SET viewed=viewed+1 WHERE id=$id;");
Timestamp columns are for when the row was last updated. Not for other purposes.
You need to use a proper column type for your posting date.