SQL Syntax Error

Hi
This also has me baffled.

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 ’ coupons_gross_sales=coupons_gross_sales+0 where id=‘1’’ at line 1
The code is

[php]
mysql_query(“update coupons_purchase_status set coupons_purchased_count=coupons_purchased_count+$tot_cquantity, coupons_amtsaved=coupons_amtsaved+$tot_savedamt, coupons_admin_comm=coupons_admin_comm+$admin_commission, coupons_club_comm=coupons_club_comm+$club_commission, coupons_gross_sales=coupons_gross_sales+$tot_grossamt where id=‘1’”) or die(mysql_error()) ;
[/php]

Thanks in advance

I don’t know if SQL can evaluate your addition like that. You may need to evaluate before you define the query.

Thanks for the help.

Quite strange actually. If I take one of the update fields out it actually works. It does not matter what field I remove… funny.

Thanks a lot for the suggestion.
Noel

Sponsor our Newsletter | Privacy Policy | Terms of Service