quats4 Posted March 11, 2006 Posted March 11, 2006 I keep geting the following error when trying to enter product attributes. I even get the error on the test products in the test database. 1264 - Out of range value adjusted for column 'products_attributes_id' at row 1 insert into products_attributes values ('', '28', '2', '14', '', '+') Any help would be appreciated.
armadillo Posted March 11, 2006 Posted March 11, 2006 I keep geting the following error when trying to enter product attributes. I even get the error on the test products in the test database. 1264 - Out of range value adjusted for column 'products_attributes_id' at row 1 insert into products_attributes values ('', '28', '2', '14', '', '+') Any help would be appreciated. Sorry, not enough info given to make a reasonable stab at your problem. A little more background on what and where will probably be needed before a decent response can be made. www.djscollectables.com
quats4 Posted March 11, 2006 Author Posted March 11, 2006 Here is an example of what I am doing: I am inserting an attribute onto the product using the admin module. The Product ID attribute is 1. A product I have in the database is chosen. An option name and value is chosen. 0 is placed into the value price and + int the refix field. I hit insert and the following error apears: 1264 - Out of range value adjusted for column 'products_attributes_id' at row 1 insert into products_attributes values ('', '28', '1', '16', '0', '+') All the values are correct except for the first one. It should be 2 but it is not.
Guest Posted March 11, 2006 Posted March 11, 2006 you should check with phpmyadmin if the autoindex of the products_attributes table is messed up. And change it if necessary. You should have the operations tab in phpmyadmin to do that.
Jimmy_D Posted March 18, 2006 Posted March 18, 2006 I wonder if this is a mysql5 thing?????? I've just fixed a similar problem by changing the insert into query lines in the code to omit inserting the id field (which is an auto-increment primary key) For Example, change from.................. 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) . "')"); to......... tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_id, options_id, options_values_id, options_values_price, price_prefix) values ('" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "')"); Alternatively, this worked for me too...... 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) . "')"); Cheers, James.
Guest Posted March 18, 2006 Posted March 18, 2006 use the tep_db_perform instead and setup an array for the values. It's easier.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.