View Full Version : "Default" column set to "CURRENT_TIMESTAMP", but not updating

11-21-2007, 05:01 PM

In phpMyAdmin, I have a row in a table with the following specs:

* Field (name): updated
* Type: Timestamp
* Coallition: (empty)
* Attributes: (empty)
* Null: No
* Extra: (empty)

However, anytime I update a record, the "updated" field stays as the creation date of the record (not the current date). What could I be doing wrong here? What other information is needed for me to get help on this? Thanks!!!

11-21-2007, 05:36 PM
In MySQL the first timestamp-type column in a table will automatically be set as current_timestamp on update. Could it be you have another timestamp-type column in the table that is positioned before this column?

11-21-2007, 06:01 PM
I actually figured out that I needed to change the "Attributes" coulmn to say "ON UPDATE CURRENT_TIMESTAMP", and then it works...

Thanks, though!