Jump to content

PHP & Mysql help needed for deleting data


squiblo

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

 

 

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.