Jump to content

How To Reseed deleted Records


vinoindiamca

Recommended Posts

Hi,

  I had a doubt in reseeding deleted values

For example if records stored like

S.No  Name    Contact

1      aaa    5656656

2      bbb    5656656

3      ccc    5656656

4      ddd    5656656

 

if i used to delete one record of second record it looks

 

S.No  Name    Contact

1      aaa    5656656

3      ccc    5656656

4      ddd    5656656

 

i need the result to be reseed values like

 

1      aaa    5656656

2      ccc    5656656

3      ddd    5656656

 

Please help in this

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/144065-how-to-reseed-deleted-records/
Share on other sites

I believe omfgthezerg's solution may be wrong, as you do NOT want to set the auto_increment back to 3. This will cause key conflicts on keys that exist that are higher than this value.

 

As shlumph posted "why do you want to do this?". You probably don't need to.

As shlumph posted "why do you want to do this?". You probably don't need to.

 

Especially if your database grows. What if you want to link this table to other tables? You'll have to update all those tables too! Is there a specific reason why you want no gaps in numbers? We can probably find a better solution...

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.