Zen Cart Logo

Category IDs

Locked

Views: 871

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
22 Aug 2007, 10:30 PM
#1
brakestorm avatar

brakestorm

New Zenner

Join Date:
Aug 2007
Posts:
39
Plugin Contributions:
0

Category IDs

I did some series of tests with fake categories to get a feel.. Now i'm ready to start and create my real categories.. How can I reset the db so that when i add the first category it starts with ID 1 and not 19.. I've gone through the DB and cant find anything that's making it start at 19.. The Categories and Categories_Description tables are empty..

TIA

22 Aug 2007, 10:45 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Category IDs

Because these IDs need to be unique, they are set to auto increment in the database. The current auto increment value is held internally and applied by MySQL.

You can reset it by either deleting and re-creating tables or marginally less radically by using the MySQL truncate command. Both of these however would require that you have a fairly good understanding of how your categories and products tables are linked to other tables and that you make sure that all linked tables are treated in the same way, otherwise you could seriously screw up your database. This wiki entry might help.

However, there's no real harm in having IDs that don't start at one, so why take this risk?