Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Need To Set ID Categories Back To 1

Need To Set ID Categories Back To 1

Views: 758

Results 1 to 3 of 3
30 Jan 2015, 5:43 PM
#1
tonysebay avatar

tonysebay

New Zenner

Join Date:
Sep 2006
Location:
Brooklyn, New York
Posts:
35
Plugin Contributions:
0

Need To Set ID Categories Back To 1

Hello All! It has been a long awhile since I needed help but I have always found my answers somewhere here :) I am faced with a simple problem for some, for me it is hair pulling! I recently upgraded to 1.5.4 as always I just do a fresh install with a new database ect.. I use Easy Populate 4 to import all my items and everything goes fast and perfect. However, this time I clicked the import twice by mistake and I doubled my categories. So I thought just by deleting all the products and categories the problem would correct itself, It did not... How do I Reset or delete all the ID Categories so I have ID Category 1 again? My ID Categories start at 108. If I delete the catogry, rather then start at 1 the numbers keep going up 109 ect... Hope I was clear Thanks For any response..... Tony

30 Jan 2015, 5:51 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Need To Set ID Categories Back To 1

If you're not willing to wipe the database and start over, then you'll need to delete the unwanted categories and then use phpMyAdmin to alter the "categories" table structure by setting the "auto-increment" value to 1.

(And keep in mind that if you have any entry in the table the "next" number will be the one that comes after whatever id is already in the table. So if you want to start from 1, be sure to remove all records from that table.)

(And, in case you're thinking of deleting categories via phpMyAdmin, don't. If you use the ZC admin (or EZP) then it'll delete the corresponding category description records too, thus keeping the database synchronized properly.)

30 Jan 2015, 6:04 PM
#3
tonysebay avatar

tonysebay

New Zenner

Join Date:
Sep 2006
Location:
Brooklyn, New York
Posts:
35
Plugin Contributions:
0

Re: Need To Set ID Categories Back To 1

I guess to have it all perfect, wiping the database clean is the only true solution. Thanks so much for the reply!!!