views:

33

answers:

2

I have a timestamp column in my database, and i use it for almost every field, but now, i just want to update the hit counter.. and i do not want to update the timestamp column with it. I use the timestamp field to see the last 'content' update. Not for every hit.

Is it possible to let mysql stop updating the timestamp column for just one query?

A: 

That's why I never use timestamp in my web projects. As I have full control on my queries, I can always set update time manually, without relying on the unpredictable timestamp mechanism.

Col. Shrapnel
A timestamp can be handy. Less writing, except in this case.
Nique
@Nique I just prefer stability and predictability over less writing. Actually debugging take more tame than writing, so I'd better ease debugging part
Col. Shrapnel
A: 
UPDATE mytable SET counter_field = counter_field + 1,
timestamp_field = timestamp_field
DulabCMS
Great, stupid i didnt thought about this. Thank you!
Nique