Jump to content

Archived

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

hho

orders_id increment problem..

Recommended Posts

I am having some trouble with the orders_id increment. Couldn't find a good thread, so I'm starting a new one.

 

In my database the last order_id is 3 digits (144), but when a new order is placed I get a 10 digit id number. So far no problem, but when the next customer places an order he gets a error message "1062 - Duplicate entry '2147483647' for key 'PRIMARY'".

 

Until finding a solution I have been manually changing the order_id in PHPMyAdmin, but if a new customer wants to place an order when I have not had time to do so - I have a problem!!

 

It seems the problem is not tied to any specific payment solution.

 

I have been going through where the counter could come from in the SQL, but have not so far been able to find any counter with a high number, or that could lead to the result. And, I have not been able to find any instance in the db that would suggest that the new entry would be a duplicate as the error message suggests...

 

Any help is very very much appreciated!!

Share this post


Link to post
Share on other sites

2147483647 is the maximum number that MySQL will allow for a INT, so that would suggest the problem is at the database - have you added any "add on" that could affect the database in such a manner?

 

Using phpmyadmin, check the auto_increment value for the problem field in the orders table.


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

Thank you very much for the reply!!

 

No, I have not added any addon. The value for orders_id is int(11)

 

But I still think it's strange that the orders_id does not continue from the highest number if I have manually removed the "2147483647"-id. No?

Share this post


Link to post
Share on other sites

@@hho

 

You have auto increment problem. Check it as Burt has told. Orders_id has an auto increment value.

 

 

Find auto increment sql code:

SHOW TABLE STATUS LIKE 'orders'

 

Change example:

ALTER TABLE `orders` AUTO_INCREMENT =144


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

Thank you, Thank you, Thank you!!

 

The SQL command did it!!

 

You wouldn't believe how grateful I am!!

Share this post


Link to post
Share on other sites

×