chino259 Posted April 8, 2011 Share Posted April 8, 2011 Hi there, I had imported about 4000+ Items to my prestashop, and have gotten rid of all the products.Now i seem to add a new product 1 by 1, and it adds an ID Number of 4226+I would really like to get the Product ID Numbers to start from 1. If anyone can please tell me what table(s)to edit in my PHPMyAdmin in order to accomplish this.I tried "ALTER TABLE ps_product AUTO_INCREMENT = 1"and"ALTER TABLE ps_product_lang AUTO_INCREMENT = 1"and nothing changed, added new product and it added 4228+Hope to get some help from the community here. Link to comment Share on other sites More sharing options...
shokinro Posted April 8, 2011 Share Posted April 8, 2011 if your ps_product table is empty, then your code should work(I don't know why it doesn't work for you).if there is any record left, you can only reset the number that is bigger than biggest one of table.But for sure, the following statement will delete all data and reset the id from 1. truncate table ps_product; But, I suggest you don't reset the ids because table are connected, if you don't it correctly, it will cause error.Here is one example. Assume you reset product id from 1, but you forget to clear ps_category_product table.So please do it very carefully. Link to comment Share on other sites More sharing options...
Asenar Posted April 15, 2011 Share Posted April 15, 2011 Hi chino,If you want to insert id=1, just do it directly in the mysql base, but I m not sure this can works.The mysql command should works only if you remove every products first. the auto_increment value can't be inferior to an already existing id .If you really want to wipe your database, simply delete all tables and then make a reinstallationRegards, Link to comment Share on other sites More sharing options...
chino259 Posted April 15, 2011 Author Share Posted April 15, 2011 Hey, thanks Allot. I Have removed my test products, and tried the command i provided, and it worked.Thanks for the help. Have very limited knowledge on SQL Commands and requirements/restrictions. Link to comment Share on other sites More sharing options...
Ankit Gupta Posted April 7, 2015 Share Posted April 7, 2015 Not able to reset Id, Please help me I'm a newbie to this. Link to comment Share on other sites More sharing options...
Recommended Posts