我有一个数据库表叫history
具有以下模式:问题将数据插入到MySQL数据库表:显示DB错误
CREATE TABLE IF NOT EXISTS `history` (
`id` int(11) NOT NULL,
`history_date` datetime DEFAULT NULL,
`sql_query` text,
`authuser` varchar(200) DEFAULT NULL,
`ip` varchar(100) DEFAULT NULL,
`authId` int(11) NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=618 DEFAULT CHARSET=latin1;
我试图在PHP它返回下面的错误运行脚本:
HIST DB Error :(INSERT into history(history_date,sql_query,ip,authuser,authId) VALUES(1441378485,'UPDATE itemstypes SET typedesc="Keyboard",hassoftware=0 WHERE id="10"','10.16.7.44','superadmin','6')):Incorrect datetime value:1441378485 for column 'history_date' at row 1
如果我通过我的本地主机的phpmyadmin的是插入运行查询INSERT into history(history_date,sql_query,ip,authuser,authId) VALUES(1441378485,'UPDATE itemstypes SET typedesc="Keyboard",hassoftware=0 WHERE id="10"','10.16.7.44','superadmin','6')
但随着数据类型不匹配,在history_date列,0000-00-00 00:00:00
被存储。 现在,当我在现场服务器运行相同的时候,我收到上述错误。 可能是什么问题?请告诉我。服务器中是否有配置问题?请帮帮我。
在此先感谢。
'1441378485'不是有效的日期时间格式为'YMD H:我:s' –