Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2011
    Posts
    11
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Column count doesn't match value count at row 1

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

    Code:
    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

    Code:
    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.

  • #2
    Regular Coder
    Join Date
    Mar 2011
    Posts
    148
    Thanks
    0
    Thanked 20 Times in 20 Posts
    A comma is missing between 'Test City' and 'Test'
    Also, you have set 21 columns, but 20 values, so they don't match.

  • Users who have thanked MarPlo for this post:

    Beebe (04-09-2011)

  • #3
    New Coder
    Join Date
    Apr 2011
    Posts
    11
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thanks a bunch!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •