开发者

PHPMyAdmin 2 Timestamp Fields

开发者 https://www.devze.com 2023-04-06 03:29 出处:网络
I have an issue. I have created 2 timestamp fields within a table \'created\' and \'last_updated\'. Both are timestamps. \'last_updated\' is set to the last time the user logged in, and \'created\' i

I have an issue.

I have created 2 timestamp fields within a table 'created' and 'last_updated'. Both are timestamps. 'last_updated' is set to the last time the user logged in, and 'created' is the time of creation on that account.

I am setting both defaults to 'none'. But, I can see in the list view that 'created' has

on update CURRENT_TIMESTAMP No  CURRENT_TIMESTAMP   ON UPDATE CURRENT_TIMESTAMP

I've tried to edit this column on it's own, and after it saves it still says the sam开发者_StackOverflowe thing.

I don't want any defaults. How can I change this?


ALTER TABLE `tablename` CHANGE COLUMN `last_updated` 
                                      `last_updated` TIMESTAMP NULL  ;

And the default of a timestamp cannot be a random string value -- it has to be a timestamp.

0

精彩评论

暂无评论...
验证码 换一张
取 消