sql语法中的奇怪错误

dou*_*ale 2 php mysql sql opencart

我有几行代码可以在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.
Run Code Online (Sandbox Code Playgroud)
$getcouponinfo1 = mysql_query("select * from order where coupon_id = $coupon_id")
      or die(mysql_error());
Run Code Online (Sandbox Code Playgroud)

其余的代码可以在这里找到.

Mat*_*Mat 7

order 是SQL中的关键字,您需要引用该表名.

select * from `order` where ...
Run Code Online (Sandbox Code Playgroud)