Page 1 of 1

could someone look at my sql please?

Posted: Sat Aug 08, 2009 7:19 pm
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

Re: could someone look at my sql please?

Posted: Sat Aug 08, 2009 7:26 pm
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,...

Re: could someone look at my sql please?

Posted: Sat Aug 08, 2009 7:29 pm
by jabberwok
Thanks so much, I would never have thought of that