SQL查询失败,42000 1064

时间:2014-07-01 23:27:33

标签: mysql sql laravel

此查询:

INSERT INTO languages(id_639_3,part2B,part2T,part1,scope,language_type,ref_name,comment) VALUES ('aaa','','','','I','L','Ghotuo','');

失败,出现以下错误:

[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 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 'INSERT INTO languages(id_639_3,part2B,part2T,part1,scope,language_type,ref_na' at line 1 (SQL: INSERT INTO languages(id_639_3,part2B,part2T,part1,scope,language_type,ref_name,comment) VALUES ('aaa','','','','I','L','Ghotuo',''))

1 个答案:

答案 0 :(得分:0)

INSERT INTO languages (id_639_3,part2B,part2T,part1,scope,language_type,ref_name,comment)
VALUES ('aaa','','','','I','L','Ghotuo','');

为什么不尝试没有'' / null值?像这样:

INSERT INTO languages (id_639_3,scope,language_type,ref_name)
VALUES ('aaa','I','L','Ghotuo');

要获得更好的错误消息,请将其分成几行。 - 您还希望在table_name和括号内的column_names之间放置一个空格。