未知的 mysql 语法错误


Unknown mysql syntax error

我有一个mysql查询,但不断收到语法错误。我通过不同的调试工具运行它,但没有找到任何东西。是不是我错过了什么。

我的查询

 INSERT INTO futureposts
 (
    ID, 
    username, 
    postedby, 
    link, 
    message, 
    picture, 
    name, 
    caption, 
    description,  
    groups, 
    type
) 
VALUES 
('','1','CodeCompiler','CodeCompiler,'','','','','','','default','daily')

错误

您的 SQL 语法有错误;请查看与您的 MySQL 服务器版本对应的手册,了解在第 1 行的"默认"、"每日")附近使用的正确语法

您在 CodeCompiler 之后错过了 ' 代码,因此请将查询从

INSERT INTO futureposts (ID, username, postedby, link, message, picture, name, caption, description, groups, type) VALUES ('','1','CodeCompiler','CodeCompiler,'','','','','','','default','daily')

INSERT INTO futureposts (ID, username, postedby, link, message, picture, name, caption, description, groups, type) VALUES ('','1','CodeCompiler','CodeCompiler','','','','','','default','daily')

并且查询中还添加了一列,请检查并删除多余的列

你在 CodeCompiler 之后错过了 '(结束引号)

....值 (''', '1

', '代码编译器', '代码编译器','','....

另外,您需要进行的一项更改是将 12 个值提供给 11 列。我已经通过创建相同的表在我的phpmyadmin中亲自检查了。

所以你的最终查询将是

INSERT INTO futureposts (ID, username, postedby, link, message, picture, name, caption, description, groups, type) VALUES ('','1','CodeCompiler','','','','','','','default','daily');