...

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



ShootingBlanks
11-21-2007, 04:01 PM
Hello.

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

* Field (name): updated
* Type: Timestamp
* Coallition: (empty)
* Attributes: (empty)
* Null: No
* Default: CURRENT_TIMESTAMP
* 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!!!

Fumigator
11-21-2007, 04: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?

ShootingBlanks
11-21-2007, 05: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!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum