Reputation: 1442
I have such query
INSERT IGNORE INTO 2_1_accountsforpaidused (DebtorDebtAndPayment) VALUES (?,?);
And such values
Array
(
[0] => 111
[1] => 222
)
Want in column DebtorDebtAndPayment
insert VALUES (111,222)
. In one line 111
, in the next line 222
But get such error
Error stmt_for_insert_accountsforpaidused!: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1
Tried to change query to INSERT IGNORE INTO 2_1_accountsforpaidused (DebtorDebtAndPayment) VALUES ((?),(?));
the same result
What is wrong?
Upvotes: 0
Views: 3764
Reputation: 219874
You're telling mysql you want to insert into one column and then you're providing it with two values. You either need to:
Add the second column your are inserting into to your query
Remove one of the values
Alter the query so it is doing two inserts of one value
Number 3 looks like what you want:
INSERT IGNORE INTO 2_1_accountsforpaidused (DebtorDebtAndPayment) VALUES (?),(?);
Upvotes: 3