简体   繁体   中英

MySQL Error - Inserting into Table

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!

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.

you need to use backticks. order is reserved keyword.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM