Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

does anyone know this error? 1264 ?


Guest

Recommended Posts

Hi, does anyone know this error? 1264 ?

 

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

 

insert into products_notifications (products_id, customers_id, date_added) values ('', '2', now())

 

[TEP STOP]

Link to comment
Share on other sites

this is the table you are inserting into:

 

CREATE TABLE products_notifications (
 products_id int NOT NULL,
 customers_id int NOT NULL,
 date_added datetime NOT NULL,
 PRIMARY KEY (products_id, customers_id)
);

 

as you can see, products_id is - and that's certainly a good idea :-) - a required filed, and must be an integer. You aresubmitting an empty string '', so it will be rejected. In the form you are processing, you have lost the products_id

 

Best woukld be to compare the files with vanilla ones

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

you did what and on which file?

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

this was adefault osCommerce table it was already in your database and only posted by me to show you the table structure, as most posters in these threads do not check their database when they get column/insert error messages.

In any case, I guess you should compare the file you get the error message on (account_notifications.php ???) with a vanilla osCommerce file from the current download.

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

This is due to MySQL 5 enforcing standards more strictly than MySQL 4. An empty integer string was acceptable to MySQL 4. It's not acceptable to MySQL 5. You can get around the problem by disabling the MySQL 5 STRICT requirement.

 

Open my.ini in the MySQL installation folder and comment out these two lines:

 

# Set the SQL mode to strict

# sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_E NGINE_SUBSTITUTION"

Link to comment
Share on other sites

  • 2 months later...

This has been one of the most helpful pieces of information I've found on this site! Thank you so very much!

 

This is due to MySQL 5 enforcing standards more strictly than MySQL 4. An empty integer string was acceptable to MySQL 4. It's not acceptable to MySQL 5. You can get around the problem by disabling the MySQL 5 STRICT requirement.

 

Open my.ini in the MySQL installation folder and comment out these two lines:

 

# Set the SQL mode to strict

# sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_E NGINE_SUBSTITUTION"

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...