Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1
    Join Date
    Dec 2006
    Location
    Vancouver Island, BC
    Posts
    50
    Plugin Contributions
    0

    Default Count doesn't match value

    Can anyone help me fix my attributes controller? I installed 'Improved Attributes Controller' and...well it wasn't improved. Looked promising as it did exactly what I wanted it to by sorting things nicely, but then when I went to apply the attributes I get this error:

    1136 Column count doesn't match value count at row 1
    in:
    [insert into products_attributes values (0, '5', '1', '2', '0', '+', '0', '1', '0', '+', '0', '0', '1', '', '1', '0', '0', '0', '0', '0', '', '', '0', '0', '0', '0', '0')]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

    I'm pretty desperate to get things working again as I have limited time to stock the store so any help with getting this fixed is much appreciated. I don't really want to lose anything if possible. Hoping for a person much smarter than myself to help as I've tried all the fixed I could find via searching and don't want to muck things up further.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Count doesn't match value

    /admin/attributes_controller.php
    line 242 (circa v1.3.7 original edition, not "enhanced"):
    Code:
     $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . "
    change that to this instead:
    Code:
      $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order, product_attribute_is_free, products_attributes_weight, products_attributes_weight_prefix, attributes_display_only, attributes_default, attributes_discounted, attributes_image, attributes_price_base_included, attributes_price_onetime, attributes_price_factor, attributes_price_factor_offset, attributes_price_factor_onetime, attributes_price_factor_onetime_offset, attributes_qty_prices, attributes_qty_prices_onetime, attributes_price_words, attributes_price_words_free, attributes_price_letters, attributes_price_letters_free, attributes_required)
    (Note: you'll need to scroll to the right to get it all .... )
    Last edited by DrByte; 20 Jan 2007 at 08:41 PM. Reason: corrected misspelled field name
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Dec 2006
    Location
    Vancouver Island, BC
    Posts
    50
    Plugin Contributions
    0

    Default Re: Count doesn't match value

    Quote Originally Posted by DrByte View Post
    /admin/attributes_controller.php
    line 242 (circa v1.3.7 original edition, not "enhanced"):
    Code:
     $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . "
    change that to this instead:
    Code:
      $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order, product_attribute_is_free, products_attributes_weight, products_attributes_weight_prefix, attributes_display_only, attributes_default, attributes_discounted, attributes_image, attributes_price_base_included, attributes_price_onetime, attributes_price_factor, attributes_price_factor_offset, attributes_price_factor_onetime, attributes_price_factor_onetime_offset, attributes_qty_prices, attributes_qty_prices_onetime, attributes_price_words, attributes_price_words_free, attributes_price_letters, attributes_price_letters_free, attributes_required)
    (Note: you'll need to scroll to the right to get it all .... )
    Thanks! That solved it.

  4. #4
    Join Date
    Dec 2006
    Location
    Vancouver Island, BC
    Posts
    50
    Plugin Contributions
    0

    Default Re: Count doesn't match value

    Well, it did solve one problem. Now, when I add attibutes and go to duplicate an item, attributes and all, I get this:

    1136 Column count doesn't match value count at row 1
    in:
    [insert into products_attributes values (0, '167', '12', '123', '0.0000', '+', '0', '1', '0', '+', '0', '0', '1', '', '1', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '', '', '0.0000', '0', '0.0000', '0', '0')]

  5. #5
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Count doesn't match value

    The same issue exists in 3 files. I only mentioned the one because that was the symptom you were reporting.

    /admin/attributes_controller.php
    /admin/includes/functions/general.php <-- This is the one affected by Copying attributes
    /admin/options_values_manager.php

    The fixes for this, and a few others related to different tables, are part of the next release.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Dec 2006
    Location
    Vancouver Island, BC
    Posts
    50
    Plugin Contributions
    0

    Default Re: Count doesn't match value

    Is there a hack to fix the 'copying attributes' issue?


    Quote Originally Posted by DrByte View Post
    The same issue exists in 3 files. I only mentioned the one because that was the symptom you were reporting.

    /admin/attributes_controller.php
    /admin/includes/functions/general.php <-- This is the one affected by Copying attributes
    /admin/options_values_manager.php

    The fixes for this, and a few others related to different tables, are part of the next release.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Count doesn't match value

    The same fix applies ... simply add the list of field names in brackets

    /admin/includes/functions/general.php
    line 1918
    Code:
              $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order, product_attribute_is_free, products_attributes_weight, products_attributes_weight_prefix, attributes_display_only, attributes_default, attributes_discounted, attributes_image, attributes_price_base_included, attributes_price_onetime, attributes_price_factor, attributes_price_factor_offset, attributes_price_factor_onetime, attributes_price_factor_onetime_offset, attributes_qty_prices, attributes_qty_prices_onetime, attributes_price_words, attributes_price_words_free, attributes_price_letters, attributes_price_letters_free, attributes_required) values (0, '" . $products_id_to . "',
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Dec 2006
    Location
    Vancouver Island, BC
    Posts
    50
    Plugin Contributions
    0

    Default Re: Count doesn't match value

    Ahhh. I see what you mean. Thanks.

    Quote Originally Posted by DrByte View Post
    The same fix applies ... simply add the list of field names in brackets

    /admin/includes/functions/general.php
    line 1918
    Code:
              $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order, product_attribute_is_free, products_attributes_weight, products_attributes_weight_prefix, attributes_display_only, attributes_default, attributes_discounted, attributes_image, attributes_price_base_included, attributes_price_onetime, attributes_price_factor, attributes_price_factor_offset, attributes_price_factor_onetime, attributes_price_factor_onetime_offset, attributes_qty_prices, attributes_qty_prices_onetime, attributes_price_words, attributes_price_words_free, attributes_price_letters, attributes_price_letters_free, attributes_required) values (0, '" . $products_id_to . "',

  9. #9
    Join Date
    Dec 2006
    Location
    Vancouver Island, BC
    Posts
    50
    Plugin Contributions
    0

    Default Re: Count doesn't match value

    Oops. Now I'm getting this error:

    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0, '172', '12', '123', '0.0000',
    in:
    [insert into products_attributes (products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order, product_attribute_is_free, products_attributes_weight, products_attributes_weight_prefix, attributes_display_only, attributes_default, attributes_discounted, attributes_image, attributes_price_base_included, attributes_price_onetime, attributes_price_factor, attributes_price_factor_offset, attributes_price_factor_onetime, attributes_price_factor_onetime_offset, attributes_qty_prices, attributes_qty_prices_onetime, attributes_price_words, attributes_price_words_free, attributes_price_letters, attributes_price_letters_free, attributes_required) values (0, '172', values (0, '172', '12', '123', '0.0000', '+', '0', '1', '0', '+', '0', '0', '1', '', '1', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '', '', '0.0000', '0', '0.0000', '0', '0')]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.


    Quote Originally Posted by characterdriven View Post
    Ahhh. I see what you mean. Thanks.

  10. #10
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Count doesn't match value

    /admin/includes/functions/general.php
    line 1929:
    Code:
              // New attribute - insert it
    // @TODO: MySQL5
              $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values (0, '" . $products_id_to . "',
    replace with:
    Code:
              // New attribute - insert it
              $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order, product_attribute_is_free, products_attributes_weight, products_attributes_weight_prefix, attributes_display_only, attributes_default, attributes_discounted, attributes_image, attributes_price_base_included, attributes_price_onetime, attributes_price_factor, attributes_price_factor_offset, attributes_price_factor_onetime, attributes_price_factor_onetime_offset, attributes_qty_prices, attributes_qty_prices_onetime, attributes_price_words, attributes_price_words_free, attributes_price_letters, attributes_price_letters_free, attributes_required) values (0, '" . $products_id_to . "',
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v139h 1136 Column count doesn't match value count at row 1
    By riolas in forum General Questions
    Replies: 3
    Last Post: 5 Jul 2013, 07:48 AM
  2. Replies: 6
    Last Post: 25 Mar 2009, 08:41 PM
  3. Help! Column count doesn't match value count
    By rjspomer in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 27 Jun 2008, 08:09 PM
  4. After QBI Install - 1136 Column count doesn't match value count at row 1
    By Bostitch in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 2 Apr 2008, 09:24 AM

Posting Permissions

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