当我将这些值插入数据库表时,出现此错误:
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value:
'24/06/2017' for column 'registration_from' at row 1
(SQL: insert into `campus_registrations` (`campus_major_class_id`,
`registration_from`, `registration_to`, `testing`, `announcement`,
`enrollment_from`, `enrollment_to`, `updated_at`, `created_at`) values (3,
24/06/2017, 27/06/2017, 13/07/2017, 01/08/2017, 05/09/2017, 31/01/2018,
2017-06-07 09:39:31, 2017-06-07 09:39:31))
我必须先启动日期时间还是什么?
在尝试将用户从 vue js 前端注册到 laravel 后端 API 时,我遇到了同样的错误。
解决方案是将 mysql 严格模式更新为 false。如果有人知道这种方法的缺点,请留下您的评论!
//config/database.php
'mysql' => [
'strict' => false,
]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)