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?

2 Answers 2

1
UPDATE mytable SET counter_field = counter_field + 1,
timestamp_field = timestamp_field
Sign up to request clarification or add additional context in comments.

Comments

0

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.

2 Comments

A timestamp can be handy. Less writing, except in this case.
@Nique I just prefer stability and predictability over less writing. Actually debugging take more tame than writing, so I'd better ease debugging part

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.