0

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'";
2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by solvesak
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'";

Edited by urtrivedi: n/a

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.