Mike
Mike

Reputation: 6839

on duplicate key update ... time stamp not updating

I have a mySQL statement which ends in:

ON DUPLICATE KEY UPDATE ....

And then I go and update all my values in my row. My issue is in my table when I created it I have a date column with data type:

TIMESTAMP

And default entry is:

CURRENT_TIMESTAMP

My issue is that I need the timestamp to update too. Is there a way to have mySQL auto update the time stamp when I update everything else manually?

Upvotes: 1

Views: 1032

Answers (1)

Franklin Innocent F
Franklin Innocent F

Reputation: 261

You have to set on update CURRENT_TIMESTAMP for attributes in your table.

Upvotes: 2

Related Questions