Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1136 - Column count doesn't match value count at row 1


ghostbone

Recommended Posts

I know this has been done here enough times.

Ive been thru most of the threads but still cant figure out whats wrong with it.

 

I keep getting this error, while adding the attributes to my products.

 

1136 - Column count doesn't match value count at row 1

insert into products_attributes values ('', '431', '2', '31', '', '+')

[TEP STOP]

Link to comment
Share on other sites

I think I mightve had figured it out, but not sure yet

 

Can you post the complete query please? Would help to figure out what's going wrong.

 

Seems that the numder of columns you've specified doesn't match the number of colums of the values.

Link to comment
Share on other sites

Can you post the complete query please? Would help to figure out what's going wrong.

 

Seems that the numder of columns you've specified doesn't match the number of colums of the values.

 

 

tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $HTTP_POST_VARS['products_id'] . "', '" . $HTTP_POST_VARS['options_id'] . "', '" . $HTTP_POST_VARS['values_id'][$i] . "', '" . $HTTP_POST_VARS['value_price'] . "', '" . $HTTP_POST_VARS['price_prefix'] . "', '" . $HTTP_POST_VARS['type_id'] . "', '" . $HTTP_POST_VARS['options_values_qty'] . "', '" . $HTTP_POST_VARS['attribute_order'] . "', '" . $HTTP_POST_VARS['collegamento'] . "')");

 

Are you talking about this bit?

Link to comment
Share on other sites

Lines 54-61 or so, do you see this in your admin/products_attributes.php:

 

	  case 'add_product_attributes':
	$products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
	$options_id = tep_db_prepare_input($HTTP_POST_VARS['options_id']);
	$values_id = tep_db_prepare_input($HTTP_POST_VARS['values_id']);
	$value_price = tep_db_prepare_input($HTTP_POST_VARS['value_price']);
	$price_prefix = tep_db_prepare_input($HTTP_POST_VARS['price_prefix']);

	tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "')");

jon

It's all just ones and zeros....

Link to comment
Share on other sites

	  case 'add_product_attributes':
	for ($i=0;$i<sizeof($HTTP_POST_VARS['values_id']);$i++) {
	 tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $HTTP_POST_VARS['products_id'] . "', '" . $HTTP_POST_VARS['options_id'] . "', '" . $HTTP_POST_VARS['values_id'][$i] . "', '" . $HTTP_POST_VARS['value_price'] . "', '" . $HTTP_POST_VARS['price_prefix'] . "', '" . $HTTP_POST_VARS['type_id'] . "', '" . $HTTP_POST_VARS['options_values_qty'] . "', '" . $HTTP_POST_VARS['attribute_order'] . "', '" . $HTTP_POST_VARS['collegamento'] . "')");
	 $products_attributes_id = tep_db_insert_id();
	 if ((DOWNLOAD_ENABLED == 'true') && $HTTP_POST_VARS['products_attributes_filename'] != '') {
	  tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " values (" . $products_attributes_id . ", '" . $HTTP_POST_VARS['products_attributes_filename'] . "', '" . $HTTP_POST_VARS['products_attributes_maxdays'] . "', '" . $HTTP_POST_VARS['products_attributes_maxcount'] . "')");
	 }
	}

 

I see this.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...