Forums / Setting Up Categories, Products, Attributes / Count doesn't match value

Count doesn't match value

Locked
Results 1 to 20 of 26
This thread is locked. New replies are disabled.
10 Jan 2007, 04:23
#1
characterdriven avatar

characterdriven

New Zenner

Join Date:
Dec 2006
Posts:
53
Plugin Contributions:
0

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:smartass: 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.
20 Jan 2007, 19:11
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Count doesn't match value

/admin/attributes_controller.php
line 242 (circa v1.3.7 original edition, not "enhanced"):
 $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . "

change that to this instead:
  $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 .... )
22 Jan 2007, 05:31
#3
characterdriven avatar

characterdriven

New Zenner

Join Date:
Dec 2006
Posts:
53
Plugin Contributions:
0

Re: Count doesn't match value

DrByte:

/admin/attributes_controller.php
line 242 (circa v1.3.7 original edition, not "enhanced"):
 $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . "
change that to this instead:
  $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.
24 Jan 2007, 15:51
#4
characterdriven avatar

characterdriven

New Zenner

Join Date:
Dec 2006
Posts:
53
Plugin Contributions:
0

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')]
25 Jan 2007, 01:36
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

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.
25 Jan 2007, 06:46
#6
characterdriven avatar

characterdriven

New Zenner

Join Date:
Dec 2006
Posts:
53
Plugin Contributions:
0

Re: Count doesn't match value

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


DrByte:

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.
26 Jan 2007, 03:27
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

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
          $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 . "',
26 Jan 2007, 20:51
#8
characterdriven avatar

characterdriven

New Zenner

Join Date:
Dec 2006
Posts:
53
Plugin Contributions:
0

Re: Count doesn't match value

Ahhh. I see what you mean. Thanks.

DrByte:

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

/admin/includes/functions/general.php
line 1918
          $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 . "',
26 Jan 2007, 20:58
#9
characterdriven avatar

characterdriven

New Zenner

Join Date:
Dec 2006
Posts:
53
Plugin Contributions:
0

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.


characterdriven:

Ahhh. I see what you mean. Thanks.
27 Jan 2007, 16:36
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Count doesn't match value

/admin/includes/functions/general.php
line 1929:
          // New attribute - insert it
// @TODO: MySQL5
          $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values (0, '" . $products_id_to . "',

replace with:
          // 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 . "',
28 Jan 2007, 05:33
#11
characterdriven avatar

characterdriven

New Zenner

Join Date:
Dec 2006
Posts:
53
Plugin Contributions:
0

Re: Count doesn't match value

Thanks again for your help. That seems to be it as all attributes are playing nicely now. Much appreciated.

DrByte:

/admin/includes/functions/general.php
line 1929:
          // New attribute - insert it
// @TODO: MySQL5
          $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values (0, '" . $products_id_to . "',
replace with:
          // 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 . "',
07 Apr 2007, 10:05
#12
vivaraquel avatar

vivaraquel

Zen Follower

Join Date:
Sep 2004
Posts:
305
Plugin Contributions:
0

Re: Count doesn't match value

I've done the previous steps as I was getting that error messagw.

When I go to admin>cat>products with attributes stock I now get this error message:
1146 Table 'easybead_zc1.zen_products_with_attributes_stock' doesn't exist
in:
[select * from zen_products_with_attributes_stock where products_id="241"]

aaaah you gotta have a laugh!!
07 Apr 2007, 11:01
#13
vivaraquel avatar

vivaraquel

Zen Follower

Join Date:
Sep 2004
Posts:
305
Plugin Contributions:
0

Re: Count doesn't match value

Not laughing now. I can't add products to cart, even products with no attributes cuz I get the quoted error.

I really need help fast for this, my cart is out of order. And I have no idea what it means. Even though I have tried to add a product order than product id#241, the message keeps coming up.

Thanks.
07 Apr 2007, 11:28
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Count doesn't match value

vivaraquel:

I've done the previous steps as I was getting that error messagw.

When I go to admin>cat>products with attributes stock I now get this error message:
1146 Table 'easybead_zc1.zen_products_with_attributes_stock' doesn't exist
in:
[select * from zen_products_with_attributes_stock where products_id="241"]

You partially installed a contribution. Apparently for attribute stock. But you didn't do the database part. Presumably there are instructions for that in the readme files for the contribution.

I suggest you go to the contribution's readme / installation instructions and double-check everything. Failing that, report your problem in the support thread for that contribution.
07 Apr 2007, 11:41
#15
vivaraquel avatar

vivaraquel

Zen Follower

Join Date:
Sep 2004
Posts:
305
Plugin Contributions:
0

Re: Count doesn't match value

Thanks for that DrByte. That must have been the part I didn't understand on how to do.

Do I upload the stock_attribute.sql file via ftp or through the tools>install SQL patches?

Thank you for your prompt reply.
23 Nov 2007, 01:53
#16
characterdriven avatar

characterdriven

New Zenner

Join Date:
Dec 2006
Posts:
53
Plugin Contributions:
0

Re: Count doesn't match value

This solution worked for single items, but I am trying to copy attributes to another item and to another category and I'm getting the same error that I was getting with adding attributes to an item. Can you tell me which files and/or tables need to be adjusted to make this work? It would be great to get the mod to work as it should with the option on left and values in drop down list, but I'll settle for copying attributes if I can get this to work.
Thanks!

DrByte:

/admin/includes/functions/general.php
line 1929:
          // New attribute - insert it
// @TODO: MySQL5
          $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values (0, '" . $products_id_to . "',
replace with:
          // 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 . "',
07 Apr 2008, 18:50
#17
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Posts:
10,475
Plugin Contributions:
9

Re: Count doesn't match value

vivaraquel:

Do I upload the stock_attribute.sql file via ftp or through the tools>install SQL patches?
tools>install SQL patches
12 Jul 2008, 15:19
#18
gfogleman avatar

gfogleman

New Zenner

Join Date:
Oct 2007
Posts:
22
Plugin Contributions:
0

Re: Count doesn't match value

I have a similar issue, but with regard to the Authorize.Net Sim module. My error is:

1136 Column count doesn't match value count at row 1
in:
[insert into zen_orders_status_history (comments, po_number, orders_id, orders_status_id, date_added) values ('Credit Card payment. AUTH: 507639. TransID: 1908858370.' , '82','', now() )]


My code in catalog/includes/modules/payment/authorizenet_aim.php is:

function after_process() {
global $insert_id, $db;
$db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (comments, po_number, orders_id, orders_status_id, date_added) values ('Credit Card payment. AUTH: " . $this->auth_code . ". TransID: " . $this->transaction_id . ".' , '". (int)$insert_id . "','" . $this->order_status . "', now() )");
return false;
}

I am not spotting the issue but am surely overlooking the obvious. Any ideas?

Thanks!

Gary
12 Jul 2008, 23:44
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Count doesn't match value

gfogleman:

I have a similar issue, but with regard to the Authorize.Net Sim module.

gfogleman:


My code in catalog/includes/modules/payment/authorizenet_aim.php is:


So, which one are you using? SIM or AIM?
What version of Zen Cart?
13 Jul 2008, 16:13
#20
gfogleman avatar

gfogleman

New Zenner

Join Date:
Oct 2007
Posts:
22
Plugin Contributions:
0

Re: Count doesn't match value

OOPS! I meant my Authorize.Net AIM module.

Version 1.3.7.1