I get this error:
#1136 - Column count doesn't match value count at row 1?
When I try to do this:
INSERT INTO folding_cartons
(part_no, description, count, size, pdf_link, min, max, current)
VALUES ('240-63100-00’,‘YB MV Cherry’, ‘90’,‘3 x 2-11/16 x 5-5/64’,
‘http://www.logicpkg.com/data/hero/copies/240-63100-00.pdf','0','0','0')
What does the error mean?
Here's what I suggest. I use the SET to insert instead of the common way to naming columns and them values. It is very simple to understand and you know which column has what. Also, to change this into an UPDATE is very simple since it's the same structure (just change the INSERT INTO to UPDATE and add a WHERE clause).
INSERT INTO `folding_cartons` SET
`part_no` = '240-63100-00',
`description` = 'YB MV Cherry',
`count` = 90,
`size` = '3 x 2-11/16 x 5-5/64',
`pdf_link` = 'http://www.logicpkg.com/data/hero/copies/240-63100-00.pdf',
`min` = 0,
`max` = 0,
`current` = 0;
The single quotes around your strings are different, though I have no idea why. I pasted your query into gedit and used the normal single quote (ascii 39), and I was able to insert successfully.
INSERT INTO folding_cartons (part_no, description, count, size, pdf_link, min, max, current) VALUES ('240-63100-00','YB MV Cherry', '90','3 x 2-11/16 x 5-5/64', 'http://www.logicpkg.com/data/hero/copies/240-63100-00.pdf','0','0','0');
Again, no clue where the Was this query code-generated or did you paste it into some editor?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With