soycharliente Posted June 29, 2009 Share Posted June 29, 2009 I have a table with 1300ish entries. The table has fields: id, title, category, desc, etc... Some of the rows have been deleted for various reasons. So there are lots of gaps in the id numbering. It doesn't matter that they are there since I wrote the code to ORDER BY id for every load. I was just curious if it was possible to take all the entries that are there and renumber them sequentially while also setting the autoincrement_next to be whatever it would need to be. Is there some command in MySQL or button/choice in phpMyAdmin to do this? Again, just curious. Quote Link to comment https://forums.phpfreaks.com/topic/164126-re-number-db-entries/ Share on other sites More sharing options...
celsoendo Posted June 30, 2009 Share Posted June 30, 2009 You can't do this for 2 reasons: - As you already said, it doesn't matter that there are some gaps on ids. - If you change the row's id, you'll have serious problems with relationships on other tables, right? Quote Link to comment https://forums.phpfreaks.com/topic/164126-re-number-db-entries/#findComment-866151 Share on other sites More sharing options...
soycharliente Posted June 30, 2009 Author Share Posted June 30, 2009 No. It's just one table. Again, I don't need to do it. Everything works fine. Sometimes you just wonder about things and Google didn't return anything. Quote Link to comment https://forums.phpfreaks.com/topic/164126-re-number-db-entries/#findComment-866375 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.