Re: Resetting ID
| From: | lallous | Date: | Tue, 30 Jul 2002 07:29:42 +0000 |
| Subject: | Re: Resetting ID | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110300@lists.php.net to get a copy of this message | ||
Save all the entries somewhere programmatically,
then do DELETE * FROM tablename;
re insert all the entries (of course do not enter the ID field, cause it
will be auto assigned).
gl,
"Thomas Edison Jr." <thomasedisonjr@yahoo.com> wrote in message
news:20020730060723.4748.qmail@web14107.mail.yahoo.com...
> Glory!
>
> 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?
>
> Thanks,
> T. Edison Jr.
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com