...

View Full Version : Column count doesn't match value count at row 1



Beebe
04-09-2011, 04:33 PM
Hey, I'm getting the error: "#1136 - Column count doesn't match value count at row 1" when trying to insert:


INSERT INTO `table_order` (`od_date`, `od_last_update`, `od_status`, `od_memo`, `od_shipping_first_name`, `od_shipping_last_name`, `od_shipping_address1`, `od_shipping_address2`, `od_shipping_phone`, `od_shipping_city`, `od_shipping_county`, `od_shipping_post_code`, `od_shipping_cost`, `od_payment_first_name`, `od_payment_last_name`, `od_payment_address1`, `od_payment_address2`, `od_payment_phone`, `od_payment_city`, `od_payment_county`, `od_payment_post_code`)
VALUES ('2011-04-05 20:56:47', '2011-04-05 20:56:47', 'New', 'Test', 'Testerson', '111 Test Street', 'Test', '12000 888999', 'Test City' 'Test','TE413YY', '5.00', 'Test', 'Testerson', '111 Test Street', 'Test', '12000 888999', 'Test City', 'Test', 'TE413YY');



Into the table


CREATE TABLE `table_order` (
`user_id` int(10) unsigned NOT NULL,
`od_id` int(10) unsigned NOT NULL auto_increment,
`od_date` datetime default NULL,
`od_last_update` datetime NOT NULL default '0000-00-00 00:00:00',
`od_status` enum('New', 'Paid', 'Shipped','Completed','Cancelled') NOT NULL default 'New',
`od_memo` varchar(255) NOT NULL default '',
`od_shipping_first_name` varchar(50) NOT NULL default '',
`od_shipping_last_name` varchar(50) NOT NULL default '',
`od_shipping_address1` varchar(100) NOT NULL default '',
`od_shipping_address2` varchar(100) NOT NULL default '',
`od_shipping_phone` varchar(32) NOT NULL default '',
`od_shipping_city` varchar(100) NOT NULL default '',
`od_shipping_county` varchar(32) NOT NULL default '',
`od_shipping_post_code` varchar(10) NOT NULL default '',
`od_shipping_cost` decimal(5,2) default '0.00',
`od_payment_first_name` varchar(50) NOT NULL default '',
`od_payment_last_name` varchar(50) NOT NULL default '',
`od_payment_address1` varchar(100) NOT NULL default '',
`od_payment_address2` varchar(100) NOT NULL default '',
`od_payment_phone` varchar(32) NOT NULL default '',
`od_payment_city` varchar(100) NOT NULL default '',
`od_payment_county` varchar(32) NOT NULL default '',
`od_payment_post_code` varchar(10) NOT NULL default '',
PRIMARY KEY (`od_id`),
KEY `user_id` (`user_id`)
) TYPE=MyISAM AUTO_INCREMENT=1001 ;

I can't figure out what I'm doing wrong, but it's probably something simple you guys might be able to see.

MarPlo
04-09-2011, 04:44 PM
A comma is missing between 'Test City' and 'Test'
Also, you have set 21 columns, but 20 values, so they don't match.

Beebe
04-09-2011, 05:02 PM
Thanks a bunch! :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum