MySQL: ignore timestamp attribute

I have a timestamp column in my database and I use it for pretty much every field, but now I just want to update the hit counter. And I don't want to update its timestamp column. I am using the timestamp field to see the latest "content" update. Not for every hit.

Is it possible to prevent mysql from updating the timestamp column for just one query?

+2


a source to share


2 answers


UPDATE mytable SET counter_field = counter_field + 1,
timestamp_field = timestamp_field

      



+1


a source


This is why I never use timestamp in my web projects. Since I have complete control over my requests, I can always manually set the update time without relying on an unpredictable timestamp mechanism.



0


a source







All Articles