简体   繁体   中英

“Error in mysql syntax” with no real idea of the issue

My code is throwing the error Error in mysql syntax on my line of code that inserts into the database. When I echo the insert I get

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'
)

I believe my syntax is ok. But I am very confused why I can't get more data on the error. Thoughts?

Exact error

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

RELEASE is a reserved word for mysql, can't be used as a column name or table name unquoted.

List of reserved words for MySQL here: http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM