guitarplayer Posted June 26, 2009 Share Posted June 26, 2009 Hello,I've deleted some recent orders from the Database but the Order ID doesn't continue from the last proper order.Example :Orders were at Order ID nº 110 but I have deleted some, so orders are now at Order ID nº 95But when I do a new test order, the Order ID continues from nº 110.Does anyone know whereabouts in the Database the Next Order ID is stored?Best regards,Guitar Player. Link to comment Share on other sites More sharing options...
rocky Posted June 27, 2009 Share Posted June 27, 2009 The next autoincrement value is not stored in the database as data, it is part of the structure of the table. I think the following query should reset the autoincrement: ALTER TABLE ps_orders AUTO_INCREMENT = 1 2 Link to comment Share on other sites More sharing options...
SK01 Posted August 20, 2010 Share Posted August 20, 2010 After 2 years I am bringing this thread up Where do i need to make the changes, in which file? Link to comment Share on other sites More sharing options...
MrBaseball34 Posted August 20, 2010 Share Posted August 20, 2010 You don' tmake changes in a file, per se.You run the SQL script that rocky provided against your database using phpMyAdmin or some other SQL utility that connects to your database. Link to comment Share on other sites More sharing options...
SK01 Posted August 22, 2010 Share Posted August 22, 2010 When i try to run this script:ALTER TABLE ps_orders AUTO_INCREMENT = 420It says: #1146 - Table 'database_name.ps_orders' doesn't existAnyone know what I am doing wrong here? Link to comment Share on other sites More sharing options...
rocky Posted August 22, 2010 Share Posted August 22, 2010 The table doesn't exist, so my guess is that your database prefix isn't ps_. You should change the prefix to your database prefix. Link to comment Share on other sites More sharing options...
SK01 Posted August 22, 2010 Share Posted August 22, 2010 Oh yes, i think you are right. I will try check for the right prefix and solve the problem. By the way, you got PM.. Link to comment Share on other sites More sharing options...
SK01 Posted August 22, 2010 Share Posted August 22, 2010 Worked perfectly! Thanks!! Link to comment Share on other sites More sharing options...
thehandlestudio Posted December 31, 2010 Share Posted December 31, 2010 The next autoincrement value is not stored in the database as data, it is part of the structure of the table. I think the following query should reset the autoincrement:ALTER TABLE ps_orders AUTO_INCREMENT = 1 Hi Rocky,So if my next order id was 3887 ?Do I put 3887 instead of the number 1 in your query?Regards,Mark. Link to comment Share on other sites More sharing options...
rocky Posted December 31, 2010 Share Posted December 31, 2010 Yes, set the autoincrement to whatever you want the next order ID to be. 1 Link to comment Share on other sites More sharing options...
thehandlestudio Posted December 31, 2010 Share Posted December 31, 2010 Thanks for the help.Regards,Mark. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now