Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Attributes Error


PhilD

Recommended Posts

Posted

When setting up product attributes, Product Options and Product Values appears to work fine, when I go to set the Product attributes, I get the following sql error;

 

1264 - Out of range value adjusted for column 'products_attributes_id' at row 1

 

insert into products_attributes values ('', '44', '1', '2', '', '+')

 

[TEP STOP]

 

Any suggestions?

 

Thanks.

Posted

I think I see the problem in products_attributes.php

 

		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) . "')");

 

The first value is blank and MySQL 5 does not like that. The field products_attributes_id is the primary key and auto increment.

 

My sql skills are pretty much non existent, anyone know a fix for this?

 

Thanks

Posted

I think I figured it out, or at least it now works as far as I can see. For anyone else with the problem I replaced the empty products_attributes_id with null as follows;

 

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

Archived

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

×
×
  • Create New...