change id numbers back in order

How to use phpmyadmin.... phpmyadmin related arguments. Even phpMyAdmin issues

Moderators: egami, macek, gesf

Post Reply
bufhal
New php-forum User
New php-forum User
Posts: 37
Joined: Tue May 04, 2004 5:11 pm

Fri Sep 24, 2004 7:06 am

Hello;
I have a mysql database and using phpmyadmin to add records to a table. I started off with and id (primary key) of 001 and the records were all in order up to 350. Then I added more records all at once and now my id's are scattered and not on order. Is there anyway to change the id's (all at once) so the record and record id's are in order with no skipped id's?
If you have any questions--let me know.
Thank you in advance for any help. :)

User avatar
swirlee
Moderator
Moderator
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Mon Sep 27, 2004 6:43 am

You could do this with a PHP script, but why bother? You shouldn't rely on AUTO_INCREMENT IDs to be contiguous. auto_increment is for providing uniqueness, not continuity. I can't think of a situation in which it would be a hindrance to have "holes" in your IDs, though I'm open to suggestion.
Image

bufhal
New php-forum User
New php-forum User
Posts: 37
Joined: Tue May 04, 2004 5:11 pm

Mon Sep 27, 2004 6:52 am

thank you..your right. And I am new to this -just foun total records.im all set

Post Reply