eastcoastdubs Posted February 14, 2003 Share Posted February 14, 2003 I am in the process of automating users profiles so they can log in and change their CAR information. Since I am in the test phase I put random info in and everything works fine. My problem is that when I delete a record ( up to 17 so far from testing ) The autoincremented number keeps going from 17 to 18 and so on. How do I reset the indexes so it starts at 1 again? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/149-how-do-i-reset-the-index-usernumber-that-is-autoincrement/ Share on other sites More sharing options...
effigy Posted February 14, 2003 Share Posted February 14, 2003 delete from table_name wipes out all data and resets increment. Quote Link to comment https://forums.phpfreaks.com/topic/149-how-do-i-reset-the-index-usernumber-that-is-autoincrement/#findComment-451 Share on other sites More sharing options...
MannX Posted February 16, 2003 Share Posted February 16, 2003 Hi, Maybe eastcoastdubs also needs to know how to make use of the blanked out record IDs. Say for instance, if there is a table with 10 record rows and indexed between 1 to 10 . Then the whole record on index 5 row is deleted by DELETE FROM table_name WHERE id=\'5\'. Thus leaving the index 5 unused.... How to reuse this index 5? Anyone ? MannX.. :roll: Quote Link to comment https://forums.phpfreaks.com/topic/149-how-do-i-reset-the-index-usernumber-that-is-autoincrement/#findComment-474 Share on other sites More sharing options...
Centrek Posted February 25, 2003 Share Posted February 25, 2003 k, i\'ve wanted to know how to do this for quite some time now. I\'m gonna jump in here, hope someone can help us out. Quote Link to comment https://forums.phpfreaks.com/topic/149-how-do-i-reset-the-index-usernumber-that-is-autoincrement/#findComment-516 Share on other sites More sharing options...
benW Posted March 1, 2003 Share Posted March 1, 2003 Why would you want to reuse a deleted key? Your request can not be done. There is no reason to delete a key and re create it. When you create an auto increment table it\'s use 99% of the time it\'s used as an easy way to do DELETE and UPDATE, SORT BY, (ASC, DESC) etc. SQL statements. Try to re think if you you really need to do these things. I\'ll bet not Quote Link to comment https://forums.phpfreaks.com/topic/149-how-do-i-reset-the-index-usernumber-that-is-autoincrement/#findComment-552 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.