列数与第 1 行的值数不匹配 [英] Column count doesn't match value count at row 1

查看:56
本文介绍了列数与第 1 行的值数不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我阅读了其他帖子,但这个问题是独一无二的.所以这个 SQL 转储文件将此作为最后一个条目.

So I read the other posts but this question is unique. So this SQL dump file has this as the last entry.

INSERT INTO `wp_posts` VALUES(2781, 3, '2013-01-04 17:24:19', '2013-01-05 00:24:19'.

我正在尝试将此值插入表中...

I'm trying to insert this value to the table...

INSERT INTO `wp_posts` VALUES(5, 5, '2005-04-11 09:54:35', '2005-04-11 17:54:35'

它给了我错误,列数与第 1 行的值数不匹配."所以我对列和行如何在这里应用的概念迷失了方向.

it gives me the error, "Column count doesn't match value count at row 1." So I'm lost on the concept of how the column and row apply here.

2781,3 不是指第 2781 行第 3 列吗?5,5 不是指第 5 行和第 5 列吗?

Doesn't 2781,3 mean row 2781 and column 3? And doesn't 5,5 mean row 5 and column 5?

推荐答案

该错误意味着您提供的数据不如表 wp_posts 包含的列多.现在数据库引擎不知道将数据放在哪些列中.

The error means that you are providing not as much data as the table wp_posts does contain columns. And now the DB engine does not know in which columns to put your data.

要解决这个问题,您必须提供要填充的列的名称.示例:

To overcome this you must provide the names of the columns you want to fill. Example:

insert into wp_posts (column_name1, column_name2)
values (1, 3)

查找表定义,看看您要填充哪些列.

Look up the table definition and see which columns you want to fill.

insert 表示您正在插入新的记录.您不是在修改现有的.为此使用 update.

And insert means you are inserting a new record. You are not modifying an existing one. Use update for that.

这篇关于列数与第 1 行的值数不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆