Click MYSQL record to update TIMESTAMP field

In my database, I have a table with a column

`LastUpdated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 

I would like to touch the entry in this table so that the LastUpdated column is automatically updated, but I do not want to change any value in this row.

Is it possible?

Thank.

+4
sql mysql
Feb 06 '14 at 7:48
source share
1 answer

AFAIK. You cannot use touch to update mysql table entries as you touch a file on unix systems. You should be asked to update the update timestamp in the LastUpdated column.

 UPDATE mytable SET LastUpdated=NOW() WHERE ... 
+5
Feb 06 '14 at 7:52
source share



All Articles