开发者

MySQL: Ignore the timestamp attribute

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 timest开发者_开发技巧amp column for just one query?


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜