我有幾行代碼應該做一個關於在Opencart的1.4.9的優惠券報告,但我不能在這個錯誤得到:奇怪的錯誤
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
'order where coupon_id = 16' at line 1.
$getcouponinfo1 = mysql_query("select * from order where coupon_id = $coupon_id")
or die(mysql_error());
其餘代碼可以找到here。
看看這個鏈接。 sql中有一些保留字。 http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html所以你需要關注@Mat的回答 – 2012-03-03 13:47:16