phppatron Posted August 5, 2007 Share Posted August 5, 2007 My question is: If I delete rows in my database via phpadmin, it remembers which row ID had previously been used, so the remaining records are 1, 3, 4, 5, 8 and the rows I deleted (2, 6, 7) no longer exist. Is there some means of having the database forget the dropped records, so the numbering is sequential? Quote Link to comment https://forums.phpfreaks.com/topic/63453-autoincrement-after-deleting-rows/ Share on other sites More sharing options...
dbillings Posted August 5, 2007 Share Posted August 5, 2007 I don't know why you would want the ID to change??? For example V-bulletin uses ID's to set super admin's. If you had a database that changed id's to make them sequential it would reset a super admin as someone else. Quote Link to comment https://forums.phpfreaks.com/topic/63453-autoincrement-after-deleting-rows/#findComment-316228 Share on other sites More sharing options...
Fadion Posted August 5, 2007 Share Posted August 5, 2007 Theres no way of doing it with autoincremented primary column (meaning id), as it would not be called autoincrement. Imagine someone who has bookmarked an article at a page which is articles.php?id=10 and when he returns finds out that its not that article anymore, but it has changed to id=9. Theres no point for doing this. Quote Link to comment https://forums.phpfreaks.com/topic/63453-autoincrement-after-deleting-rows/#findComment-316230 Share on other sites More sharing options...
Barand Posted August 5, 2007 Share Posted August 5, 2007 I really wish sometimes that mysql would allocate unique random numbers instead of sequential ids to stop people complaining because their record ids are no longer neat and tidy. An auto-incremented id is just a unique identifier for that row. see http://www.phpfreaks.com/forums/index.php/topic,140306.msg596840.html#msg596840 Quote Link to comment https://forums.phpfreaks.com/topic/63453-autoincrement-after-deleting-rows/#findComment-316285 Share on other sites More sharing options...
phppatron Posted August 6, 2007 Author Share Posted August 6, 2007 ok - thanks everyone.. just proves what a newbie I am I appreciate the answers. Quote Link to comment https://forums.phpfreaks.com/topic/63453-autoincrement-after-deleting-rows/#findComment-316350 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.