为什么这个Insert语句会抛出错误?

时间:2016-12-07 17:11:47

标签: php mysql

我真的不知道为什么这句话不适用于mysql ...你有什么想法吗?我瞎了吗?

错误讯息:

1064 - 您的SQL语法出错;查看与您的MySQL服务器版本相对应的手册,以便在#VAL;(' Wampanoag Country Club',' West Hartford',' CT&#)附近使用正确的语法39;,'',' 1','','')'在第9行

INSERT INTO companies 
(companies.firmname,
companies.city,
companies.state,
companies.zip,
companies.country,
companies.address1,
companies.address2 
VALUES ('Wampanoag Country Club',
'West Hartford',
'CT',
'',
'1',
'',
'')

2 个答案:

答案 0 :(得分:1)

你错过了一个关闭)在companies.address2之后和VALUES之前

答案 1 :(得分:1)

错过结束)

 INSERT INTO companies 
                     (
                      companies.firmname, 
                      companies.city,
                      companies.state,
                      companies.zip,
                      companies.country,
                      companies.address1,
                      companies.address2
                     ) <-- need this 
VALUES 
                   (
                     'Wampanoag Country Club',
                     'West Hartford',
                     'CT',
                     '',
                     '1',
                     '',
                     ''
                   )