1

I have a little problem inserting into a table, here is the code:

mysql_query("INSERT INTO admin_menu (id, title, type, icon, parent, url, order, append, module) VALUES('', 'powerpoint', '0', 'powerpoint.png', '0', 'powerpoint/config', '0', '0', '0' ) ") or die(mysql_error()); 

it gives me the following error:

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, append, module) VALUES('', 'powerpoint', '0', 'powerpoint.png', '0', 'pow' at line 1

Any help would be greatly appreciated, thanks!

2 Answers 2

7

order is a reserved word. Wrap it in backticks

... url, `order`, append,...

You also shouldn't be using mysql_query.

Use of this extension is discouraged. Instead, the MySQLi or PDO_MySQL extension should be used.

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

Comments

3

you need to use backticks. order is reserved keyword.

mysql_query("INSERT INTO admin_menu (id, title, type, icon, parent, url, `order`, append, module)

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.