开发者

What is wrong with this SQL query? (or perhaps why doesn't MySQL like the sixth field?)

Here is my table:

id               int(11)
name             varchar(255)
description      text       
highest_bidder   int(11)
value            varchar(255)
group            int(11)

I originally didn't have the group field in there but added it later.

Anyway, I go to insert into the database using the following snippet:

INSERT INTO name_of_table_removed
(id,name,description,highest_bidder,group,value)
VALUES
(2,"...","...",0,3,"$45.99")

And I g开发者_如何学运维et an error:

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 'group,value) VALUES (2,"...","...",0,3,"$45.99")' at line 1

What am I missing?


Group is a reserved word. Escape the field as :

`group`

..Or rename the field.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜