0

I have this query:

INSERT INTO pack_size 
    (
     pack_size_id,
     pack_contains,
     unit,
     unit_stock,
     pack_price,
     is_listed,
     is_sold_by_piece,
     baracode,
     img,
     sub_size_id,
     product_id
)

VALUES 

('1','2','3','4'),
('1','10','20','30'),
('','','',''),
('9','0','0','0'),
('1.000','9.000','15.000','20.000'),
('1','0','0','1'),
('1','1','1','0'),
('fddf','ghghf','fgfh','fgfh'),
('','','',''),
('1','1','1','1'),
('118','118','118','118')

ON DUPLICATE KEY UPDATE 

pack_contains=VALUES(pack_contains),
unit=VALUES(unit),
unit_stock=VALUES(unit_stock),
pack_price=VALUES(pack_price),
is_listed=VALUES(is_listed),
is_sold_by_piece=VALUES(is_sold_by_piece),
baracode=VALUES(baracode),
img=VALUES(img),
sub_size_id=VALUES(sub_size_id),
product_id=VALUES(product_id)

But it gives me this error:

Error: Column count doesn't match value count at row 1

Table: enter image description here

Sami Al-Subhi
  • 4,406
  • 9
  • 39
  • 66

1 Answers1

0

you have big mistake, pack_size_id is primary key and also is auto increment so you pass Value(1) multiple times to pack_size_id , this is your mistake....

Mit Cod
  • 9
  • 4