Reputation: 3083
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
Upvotes: 2
Views: 73
Reputation: 4565
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
Upvotes: 8