-1
INSERT into error_log
(id_user, id_error, severity, date)
VALUES
('93, '1', '6', '1285886665')
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1', '6', '1285886794')' at line 4
表
CREATE TABLE `error_log` (
`id` int(25) NOT NULL auto_increment,
`id_user` int(25) NOT NULL,
`id_error` int(5) NOT NULL,
`severity` int(2) NOT NULL,
`date` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
'('93,'错过了一个结束语,考虑一个SQL突出显示的编辑器,那么你会立即发现它 – Wrikken 2010-09-30 22:54:30
也想抛出那里,技术上日期是一个保留字通常mysql会大声对你除非你用backtics包装保留字,但是date是其中一个例外,但是你永远不知道它是否会在将来发生变化并且是必需的,而且一般来说只是命名列保留字是不好的做法,所以你可能想改变那个列名到其他的东西,比如error_date或者其他东西。 – 2010-09-30 22:59:30