Jump to content

Auto_Increment


gork4life

Recommended Posts

I need help I'm with a table that primary keys auto-increments let's say we have five records listed with primary key as 1,2,3,4,5. What I want is when I delete lets say record 5, the next time I create a record I want it to be 5. Is this possible and is it recommended?

 

As an idea, we could have an interesting discussion, but the fact is, that is not supported.

Link to comment
https://forums.phpfreaks.com/topic/262587-auto_increment/#findComment-1346903
Share on other sites

On death row there is a particularly nasty character guilty of numerous murders. Having been a repeat offender all his life he has rather a large criminal records file, the ID of this file being his social security number. The guy is finally executed so his social security number is no longer required.

 

By coincidence, just after he is executed, your child is born and, as this guy no longer needs his SSN, it is reallocated to  your child. Your child, though completely innocent, now has a criminal record as long as your arm.

 

A fictitious and extreme example but nonetheless a lesson in why you don't reallocate keys.

Link to comment
https://forums.phpfreaks.com/topic/262587-auto_increment/#findComment-1346909
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.