Home  >  Article  >  Backend Development  >  使用CURRENT_TIMESTAMP作默认值的时候如何update时不更改时间

使用CURRENT_TIMESTAMP作默认值的时候如何update时不更改时间

WBOY
WBOYOriginal
2016-06-13 13:33:381027browse

使用CURRENT_TIMESTAMP作默认值的时候怎么update时不更改时间
有一个字段datetime是timestamp类型,使用CURRENT_TIMESTAMP作为默认值
当update时,没有修改这个datetime字段,时间却变成当前系统时间
有什么办法让他不变?

------解决方案--------------------
alter table xxx modify yyy timestamp defualt NULL
------解决方案--------------------
这是因为你在选取timestamp类型的时候phpmyadmin自动选择造成的,点击修改,有一个“属性”选择框,这个时候肯定是on update CURRENT_TIMESTAMP这个值,设置为空即可
------解决方案--------------------
顶起

探讨

这是因为你在选取timestamp类型的时候phpmyadmin自动选择造成的,点击修改,有一个“属性”选择框,这个时候肯定是on update CURRENT_TIMESTAMP这个值,设置为空即可

------解决方案--------------------
+1

探讨

这是因为你在选取timestamp类型的时候phpmyadmin自动选择造成的,点击修改,有一个“属性”选择框,这个时候肯定是on update CURRENT_TIMESTAMP这个值,设置为空即可
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn