我有这个错误,我似乎无法找到正确的答案。我正在用PHP编写它,但在调试后,我试图直接在phpMyAdmin上编写它。这是我的SQL查询:INSERT INTO查询中的SQL错误
INSERT INTO users ('fName' , 'lName' , 'pCity' , 'cue' , 'email' , 'pass' , 'bDate') VALUES ('Me', 'You', 'Sofia', 'adf', '***', '***', '02/02/2010')
这里是我得到的错误:
#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 ''fName' , 'lName' , 'pCity' , 'cue' , 'email' , 'pass' , 'bDate') VALUES ('Kali' at line 1
我在服务器上运行相应的PHP脚本时,得到了同样的错误。任何想法,我出错了?
只有在具有空格,特殊字符或与[保留关键字]冲突的列名上才需要反引号(http://dev.mysql.com/doc/refman/5.6/en/reserved-words。 HTML)。 – tadman
我会说,首先使用空格,特殊字符或保留关键字是不好的做法 –