这是错误:
Database Exception – yii\db\Exception
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '1504595835' for column 'updated_at' at row 1
The SQL being executed was: UPDATE `user` SET `password_reset_token`='zDPxEMdJ2EaaCf2VsI_Uf9QNf0q2MKcn_1504595835', `updated_at`='1504595835' WHERE `id`=19
Error Info: Array
(
[0] => 22007
[1] => 1292
[2] => Incorrect datetime value: '1504595835' for column 'updated_at' at row 1
)
我不知道该时间戳记将在哪里分配给Updated_at字段。
我试图将update_at的值设置为date(“ Y-m-d H:i:s”),但仍然没有运气。
我也尝试设置行为,但还是没有运气。
谁能解决这个问题?
最佳答案
您已将列“ updated_at”和“ created_at”声明为错误。您必须将其更改为
int(11)
如here中所述
关于php - 如何禁用updated_at的时间戳值?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46049077/