gpt4 book ai didi

mysql - mysql 语法错误 - 插入查询

转载 作者:行者123 更新时间:2023-11-29 14:49:31 27 4
gpt4 key购买 nike

所有列名称都是正确的,数据类型也应该没问题,但这会抛出:

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 'desc, owner, burl) VALUES ('1', '2', '3', '4', '5')' at line 1

mysql_query("INSERT INTO servers (ip, name, desc, owner, burl) VALUES ('1', '2', '3', '4', '5')") or die(mysql_error());

最佳答案

mysql_query("INSERT INTO servers (ip, name, `desc`, owner, burl) VALUES ('1', '2', '3', '4', '5')") or die(mysql_error());

确保对使用 DESC 等特殊单词的列名称加反引号

关于mysql - mysql 语法错误 - 插入查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6090446/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com