Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error Message While Trying To Insert Options


dialdin

Recommended Posts

Posted

I got this error while trying to add an option to a product in a new store. I started with the osCommerce standard template and before I deleted anything from the original Product Options or Option Values I wanted to apply some to a few of my products as a test to see how these features work. In trying to apply my first Option I got this error. It doesn't matter which product I try to apply any option to, it is always the same error. I then tried deleting everything and building my own options list and still I get the same error.

 

Here is the exact error displayed:

 

1366 - Incorrect integer value: '' for column 'products_attributes_id' at row 1

insert into products_attributes values ('', '29', '1', '13', '10.0', '+')

[TEP STOP]

 

I'm no programmer but it appears to me that the first single quotes are missing a value. All of the locations for values are filled in where needed in my product attributes page. If it is the case that this value is missing, how the heck did this happen... could I have unknowingly screwed it up or is there maybe some configuration that I didn't perform like the many that I ran into during my initial install?

 

I am running this store on my local machine until it is complete and fully tested. My configuration is as follows:

osCommerce v2.2

PHP 5.2.2

Apache 2.2.4 (win32)

Window XP Pro SP2

 

After a somewhat troublesome install (minor configuration issues that this forum helped solve... THANKS), my store seemed to be working seemlessly so I was somewhat shocked by this error. I knew it was too good to be true! Any help would be hugely appreciated.

 

Thanks.

Posted

looks like you have MySQL version 5.0 with sql strict mode enabled.

you need to contact hosting provider to disable sql-mode (need to restart mysql server)

Sugiartha

------------------------------------------

concept of life: enjoy aja!

Posted
looks like you have MySQL version 5.0 with sql strict mode enabled.

you need to contact hosting provider to disable sql-mode (need to restart mysql server)

 

MySQL is version 5.0.27 it is running locally.

 

I looked in my.ini and it is indeed in strict mode. Here is the line:

sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

 

There are alot of modes available, how do you suggest I set this up?

 

Thank you.

Posted
Post the exact options you are trying to add.

 

I am trying to add the following:

Color as the Option Name

Blue as the Option Value

to any product with an Option Value of 10.00 and a Prefix of +

 

When I click on insert I get the Error.

 

Thanks.

Posted
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

 

There are alot of modes available, how do you suggest I set this up?

 

Thank you.

 

just remove the line or comment out them & restart mysql service

Sugiartha

------------------------------------------

concept of life: enjoy aja!

Posted

Option Value of 10.00 and a Prefix of +

 

 

Try the option value of Add 10.00

 

Also is this the latest version of oscommerce? If not you need to find the update in the latest download and make sure you do a complete update.

 

Could be outdated osc and updated php and mysql.

 

 

 

I am trying to add the following:

Color as the Option Name

Blue as the Option Value

to any product with an Option Value of 10.00 and a Prefix of +

 

When I click on insert I get the Error.

 

Thanks.

Posted
just remove the line or comment out them & restart mysql service

 

Thank you... I did that and it works.

My question about the mode still stands though...

do I need to set any value here?

There are a lot of options for this parameter that seem like they might be

important...

 

Thanks a bunch for getting me back to building my catalog!

  • 2 weeks later...
Posted
I got this error while trying to add an option to a product in a new store. I started with the osCommerce standard template and before I deleted anything from the original Product Options or Option Values I wanted to apply some to a few of my products as a test to see how these features work. In trying to apply my first Option I got this error. It doesn't matter which product I try to apply any option to, it is always the same error. I then tried deleting everything and building my own options list and still I get the same error.

 

Here is the exact error displayed:

 

1366 - Incorrect integer value: '' for column 'products_attributes_id' at row 1

insert into products_attributes values ('', '29', '1', '13', '10.0', '+')

[TEP STOP]

 

I'm no programmer but it appears to me that the first single quotes are missing a value. All of the locations for values are filled in where needed in my product attributes page. If it is the case that this value is missing, how the heck did this happen... could I have unknowingly screwed it up or is there maybe some configuration that I didn't perform like the many that I ran into during my initial install?

 

I am running this store on my local machine until it is complete and fully tested. My configuration is as follows:

osCommerce v2.2

PHP 5.2.2

Apache 2.2.4 (win32)

Window XP Pro SP2

 

After a somewhat troublesome install (minor configuration issues that this forum helped solve... THANKS), my store seemed to be working seemlessly so I was somewhat shocked by this error. I knew it was too good to be true! Any help would be hugely appreciated.

 

Thanks.

 

For those that does not have the option to change their PHP options here is a code fix fore you.

 

In the following file change this.

 

/admin/products_attributes.php

 

change line

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 . " values (null, '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "')");

 

\Addgod

  • 1 month later...
Posted
For those that does not have the option to change their PHP options here is a code fix fore you.

 

In the following file change this.

 

/admin/products_attributes.php

 

change line

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 . " values (null, '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "')");

 

\Addgod

 

Many, many thanks Addgod!

Worked great - wish the OSCommerce developers would have fixed this...

Archived

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

×
×
  • Create New...