Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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