Column count doesn t match value count at row 1

0 votes


I used a SQL dump file as the last entry mentioned below:-

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

I have been 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'

But I keep getting the ERROR, "Column count doesn't match value count at row 1." So I am confused and lost on the concept of how the column and row apply here. Doesn't 2781, 3 mean row 2781 and column 3 and doesn't 5,5 mean row 5 and column 5?

Feb 11, 2022 in Others by Soham
• 9,710 points
2,901 views

1 answer to this question.

0 votes

The ERROR you are receiving implies that you are providing not as much data as the table wp_posts includes the various columns and due to this, 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)

Check up the table definition and see which columns you want to fill. Following which insert means you are inserting a new record. You are not modifying an existing one. Use an update for that.

answered Feb 11, 2022 by Rahul
• 9,680 points

Related Questions In Others

0 votes
1 answer

Excel delete row if column contains value from to-remove-list

Given sheet 2: ColumnA ------- apple orange You can flag the rows ...READ MORE

answered Nov 6, 2022 in Others by narikkadan
• 63,600 points
1,571 views
0 votes
1 answer

How to increment a column value if it repeats, otherwise reset to 1?

Use COUNTIF: =COUNTIF(A$2:A2,A2) The absolute and relative cell coordinates ...READ MORE

answered Feb 4, 2023 in Others by narikkadan
• 63,600 points
815 views
0 votes
1 answer
0 votes
1 answer

Loop through each cell in a given range and change the value depending on value in a column in the same row

Use match() and if() without code at ...READ MORE

answered Mar 26, 2023 in Others by Kithuzzz
• 38,000 points
889 views
0 votes
1 answer
0 votes
0 answers
0 votes
1 answer
0 votes
1 answer

#1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’

This ERROR which is occurring will definitely ...READ MORE

answered Feb 10, 2022 in Others by Rahul
• 9,680 points
1,407 views
0 votes
1 answer

can somebody explain me what does "passing by value" and "Passing by reference" mean in C#?

To answer your question, “passing by value” ...READ MORE

answered Feb 10, 2022 in Others by Rahul
• 9,680 points
781 views
0 votes
1 answer

count() parameter must be an array or an object that implements countable in laravel

You will have to make one change ...READ MORE

answered Feb 10, 2022 in Others by Rahul
• 9,680 points
6,675 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP