Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1264 Out of range


johanbo

Recommended Posts

I have already posted about following error. Previous post:

 

Now I need help; I am blocked at the insert of new product in catalog.

 

I get following error message;

 

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

 

insert into products (products_quantity, products_model, products_price, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_image, products_date_added) values ('1', 'str-9', '5.00', null, '100', '1', '1', '', '1-2_resize (3).jpg', now())

 

What's going on ? What's wrong? What shall I do to solve the problem?

 

I will be very very grateful for soonest possible help. Thanks in advance.

 

I have tried to solve the problem as suggested by Carl Saunders, however to no avail

 

I reproduce hereafter my product-attribute table. What has to be changed?

 

I?ll be happy to spend an evening in Paris and offer a dinner to any one who can help me to solve the problem..

 

Johanbo

 

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

 

insert into products (products_quantity, products_model, products_price, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_image, products_date_added) values ('500', 'str-9', '6', null, '0.10', '1', '1', '', '1-2_resize (3).jpg', now())

 

[TEP STOP

 

Table product-attribute] in phpmyadmin

 

Champ Type Interclassement Attributs Null D?faut Extra Action

products_attributes_id int(11) Non auto_increment

 

products_id int(11) Non

 

options_id int(11) Non

 

options_values_id int(11) Non

 

options_values_price decimal(15,4) Non

 

price_prefix char(1) latin1_swedish_ci Non

Link to comment
Share on other sites

  • 3 months later...

Any good fixes so far? I have upgrade mysql server and the oscommerce files.. I think that there is an error with the db.

 

I got the same error when added a new category but once I added a value for the sort order it went through.

 

Thanks

KM

Link to comment
Share on other sites

  • 1 year later...
Any good fixes so far? I have upgrade mysql server and the oscommerce files.. I think that there is an error with the db.

 

I got the same error when added a new category but once I added a value for the sort order it went through.

 

Thanks

KM

 

OK... I've learned. The problem with this error and error 1264 - Out of range... is that those fields MUST have a number in them. So, here is some code that works. On a new product, it will set the defaults at '0' for the products quantity & products weight field. On an update, it will pull in the accurate information. I've also added *Required to those boxes so anyone who uses it knows they have to fill in the blank.

 

Here is the code.

 

 

Open admin/categories page.

 

Find:

$sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']);

 

Add after that:

if ($sort_order==''){$sort_order='0';}

 

Find:

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?></td>

 

Replace with:

 

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?> <font color="red">* Required</font></td>

 

Find:

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_quantity', $pInfo->products_quantity); ?></td>

 

Replace with:

<td class="main">

<?php if ($pInfo->products_quantity==''){

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_quantity', "0");

}else{

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_quantity', $pInfo->products_quantity);

} ?>

<font color="red">* Required</font>

</td>

 

Find:

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_weight', $pInfo->products_weight); ?></td>

Replace with:

<td class="main">

<?php if ($pInfo->products_weight==''){

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_weight', "0");

}else{

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_weight', $pInfo->products_weight);

} ?><font color="red"> * Required</font>

</td>

 

 

I hope this helps everyone out there that is looking for a remedy. Granted, it is not the best, but it works.

Good luck!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...