gpt4 book ai didi

php - 错误 : datetime column Incorrect datetime value: ''

转载 作者:行者123 更新时间:2023-11-29 06:08:16 24 4
gpt4 key购买 nike

我有日期时间列(test_date),默认值设置为 current_timestamp

但是当更新表格时它显示

Error in Updation Query
Incorrect datetime value: '' for column 'test_date' at row 1

我什至将列类型更改为时间戳,但它仍然抛出相同的错误

Error in Insertion Query insert into tbl_testimonials(test_title,test_image,test_content,test_date,status) values('hi','','this is checking','', 'Y') Incorrect datetime value: '' for column 'test_date' at row 1

我的问题不同:MySQL CURRENT_TIMESTAMP on create and on update 中的问题讨论必须在同一个表中为值加上时间戳,错误是

ERROR 1293 (HY000): Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

但是我有一个带有时间戳值的列,我的错误是

Incorrect datetime value: '' for column 'test_date' at row 1

所以我觉得我的问题不一样

请帮忙

最佳答案

如果您希望 mysql 为您做这件事,那么请不要在您的键值中包含 test_date。所以它应该像下面这样:

tbl_testimonials  
(test_title,test_image,test_content,status) values
('hi','','this is checking', 'Y')

关于php - 错误 : datetime column Incorrect datetime value: '' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40013672/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com