【发布时间】:2015-12-13 01:17:06
【问题描述】:
我有一个名为 history 的数据库表,其架构如下:
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不是有效的日期时间,格式为Y-m-d H:i:s
标签: php mysql configuration