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));
1
  • Wow, that's weird! I can't see the error. Whats the value of $table? Commented Sep 22, 2013 at 3:21

2 Answers 2

4

Order is a reserved keyword, you need to wrap it in backticks or double quotes (depending on your database config): `order` or "order".

Sign up to request clarification or add additional context in comments.

Comments

0

add quotations '' around variables

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.