0

I have the following error but I cant find the issue - can anyone else spot it - need another set of eyes:

Error near 'order, state) VALUES ('SAME',2,'1',10,1)'

DB Query:

    $query = "INSERT INTO $table (brand_name, brand_id, cat_id, order, state) VALUES (?,?,?,?,?)";
    $this->db->query($query, array($brand_name, $brand_id, $cat, $order ,$state));
4

2 回答 2

4

Order 是一个保留关键字,您需要将其用反引号或双引号括起来(取决于您的数据库配置):`order` 或“order”。

于 2013-09-22T03:21:03.947 回答
0

在变量周围添加引号''

于 2013-09-22T04:06:49.467 回答