首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >列计数与第1行错误消息php / sql中的值计数不匹配

列计数与第1行错误消息php / sql中的值计数不匹配
EN

Stack Overflow用户
提问于 2019-12-08 00:30:35
回答 1查看 43关注 0票数 0

我必须使用PHP和MySQL工作台创建一个网页来收集表单数据,并且我一直得到以下错误:

代码语言:javascript
复制
INSERT INTO tools ( id, tool1, tool2, tool3, tool4, tool5, tool6, tool7, tool8, tool9, tool10) VALUES ( '0','1', '2', '3', '4,' '5', '6', '7', '8', '9', '10')

INSERT failed: INSERT INTO tools ( id, tool1, tool2, tool3, tool4, tool5, tool6, tool7, tool8, tool9, tool10) VALUES ( '0','1', '2', '3', '4,' '5', '6', '7', '8', '9', '10')

Column count doesn't match value count at row 1

这就是我的代码的样子:

代码语言:javascript
复制
$query = "INSERT INTO tools ( id, tool1, tool2, tool3, tool4, tool5, tool6, tool7, tool8, tool9, tool10) VALUES ( '0','1', '2', '3', '4,' '5', '6', '7', '8', '9', '10')";

这就是它在工作台上的样子:

代码语言:javascript
复制
INSERT INTO tools (id, tool1, tool2, tool3, tool4, tool5, tool6, tool7, tool8, tool9, tool10) VALUES ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

我尝试过不使用id和0值,但两者都不起作用。有人知道怎么解决这个问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-12-08 01:56:50

你的代码

代码语言:javascript
复制
INSERT INTO tools ( id, tool1, tool2, tool3, tool4, tool5, tool6, tool7, tool8, tool9, tool10) 
VALUES ( '0','1', '2', '3', '4,' '5', '6', '7', '8', '9', '10')

有一个准确的误差在4到5之间的撇号被错位。

一定是这样的

代码语言:javascript
复制
INSERT INTO tools ( id, tool1, tool2, tool3, tool4, tool5, tool6, tool7, tool8, tool9, tool10) 
VALUES ( '0','1', '2', '3', '4', '5', '6', '7', '8', '9', '10')
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59231485

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档