My sql:
$tsqla="INSERT INTO xcal (id, date, 1sfta, 1sftb, 2sfta, 2sftb, 3sfta, 3sftb, 4sfta, 4sftb, 5sfta, 5sftb, 6sfta, 6sftb, location) VALUES ('NULL','" . $tsdate . "', '". implode("','",$date_array[$jyr.'-'.$jmnth.'-'.$jday])."','E')";
Which prints out like this:
INSERT INTO xcal (id, date, 1sfta, 1sftb, 2sfta, 2sftb, 3sfta, 3sftb, 4sfta, 4sftb, 5sfta, 5sftb, 6sfta, 6sftb, location)
VALUES ('NULL','2010-008-31', '0','0','0','0','0','0','0','0','0','0','0','0','E')
There are 15 columns, 15 values, why would i get the dreaded:
“Column count doesn’t match value count at row 1”
Any help appreciated 😀
Since
IDis alreadyauto-incrementedyou can omit it in your query clause. Then you should add abacktickin one of your fields which is thedatebecause it is a RESERVED word in MySQL.try this if it works. And one more thing, check also their respective data types.
INTfields must have values withno single quote.