> I have a table, with 4 columns. One of the column is
> ID, a Primary Key, which has Auto_Increment set on it.
> 
> 
> Now i have a lot of rows deleted and a lot of
> duplicate rows that will be deleted, and all sorts of
> stuff happening in the table.. the result is, that the
> IDs have become inconsistent.
> 
> What you get is something like
> 5,6,9,10,25,32,33 .. and so on. With many IDs missing
> etc.
> 
> What i want to do is delete the entire IDs and
> generate them again so that they are in one single
> order like 1,2,3,4,5... .like this.
> 
> And so that any new entry in the table gets the ID
> accordingly. How can i do this?

Who cares if your IDs aren't sequential?? All these IDs are for is to
provide a unique identifier for each row. That's it. If the holes are
causing a problem in your scripts, then you are using this column
incorrectly. My guess is that you'd want to read up on the COUNT() or
LIMIT functions in MySQL...

---John Holmes...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to