Knowledgebase: General
Can't Add Product Attributes in CRE Loaded After Installing QBI
Posted by Adam Liberman on 05 August 2008 01:55 AM
Problem:
The following error message appears when trying to add a Product Attribute in CRE Loaded after installing QBI:

1136 - Column count doesn't match value count at row 1
insert into products_attributes values ('', '78', '15', '77', '0', '+','1')
[TEP STOP]


Cause:
The code in CRE doesn't allow for the extra table columns added by QBI.

Solution:
In the osC file: /catalog/admin/products_attributes.php
Line: 47 (approximate, may be different in your version)
Change:

tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $_POST['products_id'] . "', '" . $_POST['options_id'] . "', '" . $_POST['values_id'] . "', '" . $_POST['value_price'] . "', '" . $_POST['price_prefix'] . "', '" . $_POST['sort_order'] . "')");

To:


tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " set products_id='" .
$_POST['products_id'] . "', options_id='" . $_POST['options_id'] . "', options_values_id='" . $_POST['values_id'] . "', options_values_price='" . $_POST['value_price]' . "', price_prefix='" . $_POST['price_prefix'] . "', products_options_sort_order='" . $_POST['sort_order'] . "'");

Versions:
3.50 +
(143 vote(s))
Helpful
Not helpful