mysql - Why won't this INSERT INTO statement work? -
this pretty basic question, apologies.
i have simple sql (mysql5) table , i'm trying command line insert data it. keeps popping error , have no idea why.
this console output:
mysql> show columns queries; +-------+-----------+------+-----+-------------------+-----------------------------+ | field | type | null | key | default | | +-------+-----------+------+-----+-------------------+-----------------------------+ | id | int(11) | no | pri | null | auto_increment | | query | varchar(100) | no | | null | | | date | timestamp | no | | current_timestamp | on update current_timestamp | | match | int(11) | yes | | null | | +-------+-----------+------+-----+-------------------+-----------------------------+ 4 rows in set (0.00 sec) mysql> insert queries (query, match) values ('cheese', 4); error 1064 (42000): have error in sql syntax; check manual corresponds mysql server version right syntax use near 'match) values ('cheese', 4)' @ line 1 mysql>
what's going on? why doesn't insert command work?
match
reserved mysql word.
try instead (using backticks):
insert queries (`query`, `match`) values ('cheese', 4);
Comments
Post a Comment