Jump to content

Recommended Posts

Firstly, what I am trying to do it delete data from Mysql. To give you a better understanding, this is what happens:

  • Users adds a note, the first note they make is put in the column "notenumber" as 1
  • The user adds a 2nd note, this is then put under column "notenumber" as 2
  • and so on, and so on

 

I want the user to be able to delete a note but without messing the notenumbers up, for example if data is deleted it may look like this: notenumber 1, notenumber 2, notenumber 4.

 

How can i delete a notenumber without leaving a gap?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/187399-php-mysql-help-needed-for-deleting-data/
Share on other sites

Becuase I could end up with 2 notenumber 3's  ... for example:

 

notenumber 1, notenumber 2, notenumber 3

 

if notenumber 2 gets deleted...

 

I will have... notenumber 1 and notenumber 3

 

and when the user creates a note mysql counts the number of rows and add 1 to create a new notenumber

 

hence notenumber 1 and notenumber 2 = 2 notes

 

so the next note created will be notenumber 3 so i will have 2 note number 3's

 

 

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.