2

Error in mysql syntax我的代码在插入数据库的代码行中引发错误。当我回显插入时,我得到

INSERT INTO patches (
 name, 
 description, 
 type, 
 com1, 
 com2, 
 com1,  
 code, 
 db, 
 other, 
 tfsID, 
 release, 
 createdBy, 
 createdDtTm, 
 updatedBy, 
 updatedDtTm
) VALUES (
 'testPatch2',
 'longPatchDescription',
 'Code - Full Build',
 '0',
 '1',
 '1', 
 '0',
 '1',
 '1',
 '98765',
 '6.11.0',
 'mhopkins',
 '2013/06/26 08:58:19',
 'mhopkins', 
 '2013/06/26 08:58:19'
)

我相信我的语法没问题。但我很困惑为什么我无法获得更多关于错误的数据。想法?

确切的错误

Errormessage: 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 'release, createdBy, createdDtTm, updatedBy, updatedDtTm) VALUES ('testPatch2','l' at line 1
4

1 回答 1

8

RELEASE 是 mysql 的保留字,不能用作不加引号的列名或表名。

MySQL 的保留字列表:http: //dev.mysql.com/doc/refman/5.5/en/reserved-words.html

于 2013-06-26T15:08:42.320 回答