hho Posted September 16, 2013 Posted September 16, 2013 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!!
burt Posted September 16, 2013 Posted September 16, 2013 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.
hho Posted September 16, 2013 Author Posted September 16, 2013 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?
tgely Posted September 16, 2013 Posted September 16, 2013 @@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 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.
hho Posted September 16, 2013 Author Posted September 16, 2013 Thank you, Thank you, Thank you!! The SQL command did it!! You wouldn't believe how grateful I am!!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.