Jump to content

Column count doesn't match value count at row 1


jeff5656

Recommended Posts

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 ;

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.