php - MySQL 错误 - 插入表

标签 php mysql insert

我在插入表格时遇到一点问题,这是代码:

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()); 

它给我以下错误:

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

非常感谢任何帮助,谢谢!

最佳答案

orderreserved word .用反引号包裹它

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

你也不应该使用 mysql_query .

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

关于php - MySQL 错误 - 插入表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12886096/

相关文章:

mysql - SQL INSERT INTO 选择

mysql - 减去两次mysql

sql-server - 捕获失败的 INSERT 值

java - 我什么时候应该在 INSERT 期间使用/*+ APPEND */

php - 在我的数据库和 html 上转换相同的日期

php - htaccess重写URL php参数

php - 哪种方法更好地验证用户凭据?

mysql - 删除具有外键约束的行

PHP Prepared Statement vs mysqli_real_escape_string

python - 如何使用Python执行MariaDB数据库插入?