Page 1 of 1

auto increment

Posted: Fri May 16, 2003 5:20 am
by irealms
how do i reset the auto increment? at present it enter users with numbers 5 and over . I deleted ones i created to test (ie users 2 to 4). How do i make the id fill in the gaps again?

Posted: Fri May 16, 2003 6:26 am
by twigletmac
If you empty the table, this will reset it. Remember with auto_increment that it's supposed to be a unique identifier for a record so in general you wouldn't want to reuse numbers once a previous record has been deleted.

Mac

Posted: Fri May 16, 2003 7:30 am
by []InTeR[]
ALTER TABLE `table_to_use` auto_increment = 1

Posted: Fri May 16, 2003 8:38 am
by volka
afaik you might increase the auto_increment value of an exisiting table but not decrease it with ALTER TABLE.