squiblo Posted January 6, 2010 Share Posted January 6, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/187399-php-mysql-help-needed-for-deleting-data/ Share on other sites More sharing options...
trq Posted January 6, 2010 Share Posted January 6, 2010 How can i delete a notenumber without leaving a gap? Why? Quote Link to comment https://forums.phpfreaks.com/topic/187399-php-mysql-help-needed-for-deleting-data/#findComment-989597 Share on other sites More sharing options...
squiblo Posted January 6, 2010 Author Share Posted January 6, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/187399-php-mysql-help-needed-for-deleting-data/#findComment-989610 Share on other sites More sharing options...
trq Posted January 6, 2010 Share Posted January 6, 2010 So, the notenumber filed should be setup to auto increment within your database. Quote Link to comment https://forums.phpfreaks.com/topic/187399-php-mysql-help-needed-for-deleting-data/#findComment-989620 Share on other sites More sharing options...
squiblo Posted January 6, 2010 Author Share Posted January 6, 2010 thanks thorp, i had my logics all messed up Quote Link to comment https://forums.phpfreaks.com/topic/187399-php-mysql-help-needed-for-deleting-data/#findComment-989627 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.