Jump to content

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...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.