could someone look at my sql please?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
jabberwok
Forum Newbie
Posts: 2
Joined: Sat Aug 08, 2009 7:14 pm

could someone look at my sql please?

Post by jabberwok »

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,member,wholebean_sa,regular_sa,wholebean_ca,regular_ca,wholebean_african,r' at line 1
this is the out put of my sql variable

Code: Select all

INSERT INTO master_order (member_id,GROUP,member,wholebean_sa,regular_sa,wholebean_ca,regular_ca,wholebean_african,regular_african,wholebean_asian,regular_asian,wholebean_decaf,regular_decaf,wholebean_sampler,regular_sampler) VALUES('138','Hanna','Bobby','1','1','1','1','1','1','1','1','1','1','1','1')
Pulling my hair out!

Thanks
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: could someone look at my sql please?

Post by Eran »

group is a reserved word in MySQL, you need to escape it with backticks (or change the name of the field)

Code: Select all

INSERT INTO master_order (member_id,`group`,member,...
jabberwok
Forum Newbie
Posts: 2
Joined: Sat Aug 08, 2009 7:14 pm

Re: could someone look at my sql please?

Post by jabberwok »

Thanks so much, I would never have thought of that
Post Reply