我有点难过
我有一个 SQL 插入语句如下:
INSERT INTO region_points (suburb_id, lat, long) VALUES ('1','-33.8737357','150.8697605')
我没有发现该语句有任何问题,但是当我运行它时,我得到:
#1064 - 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 'long) VALUES ('1','-33.8737357','150.8697605')' at line 1
如有任何帮助,我们将不胜感激。
干杯
最佳答案
LONG
是 mysql 保留字。如果标识符包含特殊字符或者是保留字,则在引用它时必须引用它。
标识符引号是反引号。
INSERT INTO region_points (suburb_id, lat, `long`) VALUES ('1','-33.8737357','150.8697605')
引用:http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html
关于php - MySQL - 插入语句正确,但仍然出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26858913/