Knowledgebase: General
Can't Duplicate Products in osC after installing QBI
Posted by Adam Liberman on 09 December 2007 07:27 PM
Problem:
The following error message appears when trying to duplicate a product in osC after installing QBI:

1136 - Column count doesn't match value count at row 1
insert into products_attributes values ('', '574', '5', '22', '14.9500', '+', '2', '0', '0.0000', '', '0', '0.0000')
[TEP STOP]


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

Solution:
In the osC file: /catalog/admin/categories.php
Change:

tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $products_id . "', '" . $options['products_options_id'] . "', '" . $values['products_options_values_id'] . "', '" . $HTTP_POST_VARS['price'][$rows] . "', '" . $HTTP_POST_VARS['prefix'][$rows] . "', '" . $HTTP_POST_VARS['products_options_sort_order'][$rows] . "', '" . $HTTP_POST_VARS['product_attributes_one_time'][$rows] . "', '" . $HTTP_POST_VARS['products_attributes_weight'][$rows] . "', '" . $HTTP_POST_VARS['products_attributes_weight_prefix'][$rows] . "', '" . $HTTP_POST_VARS['products_attributes_units'][$rows] . "', '" . $HTTP_POST_VARS['products_attributes_units_price'][$rows] . "' )");

to this:

tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_id, products_options_id, products_options_values_id, options_values_price, price_prefix, products_options_sort_order, product_attributes_one_time, products_attributes_weight, products_attributes_weight_prefix, products_attributes_units, products_attributes_units_price) values ('" . $products_id . "', '" . $options['products_options_id'] . "', '" . $values['products_options_values_id'] . "', '" . $HTTP_POST_VARS['price'][$rows] . "', '" . $HTTP_POST_VARS['prefix'][$rows] . "', '" . $HTTP_POST_VARS['products_options_sort_order'][$rows] . "', '" . $HTTP_POST_VARS['product_attributes_one_time'][$rows] . "', '" . $HTTP_POST_VARS['products_attributes_weight'][$rows] . "', '" . $HTTP_POST_VARS['products_attributes_weight_prefix'][$rows] . "', '" . $HTTP_POST_VARS['products_attributes_units'][$rows] . "', '" . $HTTP_POST_VARS['products_attributes_units_price'][$rows] . "' )");

Versions:
3.50 and higher
(212 vote(s))
Helpful
Not helpful