On update current in MySQL_ TIMESTAMP

raoxiaoya 2022-06-24 07:03:03 阅读数:834

updatecurrentmysql_mysqltimestamp

Mysql If you want the system to automatically fill in the time , You can set the field type to timestamp, In this case , There will be time to create a new record ; At this point, the data has changed , This time will not change , If you want the time to update automatically , Then you need to set it to synchronize updates ON UPDATE CURRENT_TIMESTAMP, If you just use update sentence , But the value of each field does not change , Then the time will not be updated .

`upd_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP
`upd_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
copyright:author[raoxiaoya],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/175/202206240023092681.html