954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

error in your SQL syntax; check the manual

The code given below is showing error:
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,type) SELECT ex_tax.username,ex_tax.exp_id,exp' at line 1

$sql="INSERT INTO ex_cat (username,exp_id,used_category,group,type)
SELECT ex_tax.username,ex_tax.exp_id,ex_tax.category,ex_tax.group,ex_tax.type
FROM ex_tax WHERE ex_tax.username='$uname' AND ex_tax.exp_id='$exp_id' AND ex_tax.used='1'";
solvesak
Newbie Poster
8 posts since Jun 2011
Reputation Points: 10
Solved Threads: 0
 

post structure of ex_cat, and ex_tax
or try with ` around word group, because group is reserved word

$sql="INSERT INTO ex_cat (username,exp_id,used_category,`group`,type)
SELECT ex_tax.username,ex_tax.exp_id,ex_tax.category,ex_tax.`group`,ex_tax.type
FROM ex_tax WHERE ex_tax.username='$uname' AND ex_tax.exp_id='$exp_id' AND ex_tax.used='1'";
urtrivedi
Nearly a Posting Virtuoso
1,306 posts since Dec 2008
Reputation Points: 257
Solved Threads: 270
 

Thanks a lot urtrivedi :)
It is solved... ws cz of 'group' i changed it and now it works :)

solvesak
Newbie Poster
8 posts since Jun 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: