jeff5656 Posted June 20, 2010 Share Posted June 20, 2010 I get the above error (Column count doesn't match value count at row 1) with this code: $query = "INSERT INTO shop (id,store, item, priceunit, units, unitname, dateadded) VALUES ('','$store', '$item', '$priceunit','$units', '$unitname' '$dateadded')"; echo $query; mysql_query($query) or die("<br>error. ".mysql_error()); here's my table: CREATE TABLE `shop` ( `id` int(10) NOT NULL auto_increment, `store` varchar(40) NOT NULL default '', `item` varchar(60) NOT NULL default '', `units` varchar(20) NOT NULL default '', `priceunit` varchar(20) NOT NULL default '', `dateadded` date NOT NULL default '0000-00-00', `unitname` varchar(40) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; Link to comment https://forums.phpfreaks.com/topic/205348-column-count-doesnt-match-value-count-at-row-1/ Share on other sites More sharing options...
Mchl Posted June 20, 2010 Share Posted June 20, 2010 You're missing a comma (,) after '$unitname' Link to comment https://forums.phpfreaks.com/topic/205348-column-count-doesnt-match-value-count-at-row-1/#findComment-1074708 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.