When I published a UPDATE sentence in MySQL5.1, update is inapplicable, and the column of a certain current_timestamp type is updated by time when I carried out UPDATE. Will it be the data column which is updated even if current_timestamp type may not lack in UPDATE explicitly?

link|improve this question

39% accept rate
feedback

1 Answer

up vote 1 down vote accepted

When you created the table you can setup the first TIMESTAMP column with both DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP clauses, the column has the current timestamp for its default value, and is automatically updated.

You can find more information on timestamp here:

http://dev.mysql.com/doc/refman/5.0/en/timestamp.html

Matt

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.