Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reserved word in column name - insert into MySQL [duplicate]

Tags:

I have a MySQL database with the word "group" in one of the column names. I can't change this database and column's name; it's not mine.

Table users, columns: id, name, password, group, and other. I need to insert a record into this table. I tried INSERT INTO users (name, group) VALUES ('John', '9'), but it's not working because of "group".

Can you help me, how to insert a record into this table, please?

like image 508
krYsti Avatar asked Mar 21 '12 07:03

krYsti


1 Answers

Try:

INSERT INTO users (`name`, `group`) VALUES ('John', '9') 
like image 93
sikander Avatar answered Sep 19 '22 20:09

sikander