MySql - Manage a display order of data

vbteam

New Member
OK, a database of information. A column dedicated to a display order. If I make changes, like move rows or if I delete rows or add rows to the end of the database then move them up or down.I would prefer to keep the display order in sequential order with no gaps. like \[code\]1-2-3-4-5-6-7-8-9\[/code\] if I delete a row \[code\]1-2-3-4-5-7-8-9\[/code\] I may have problem later if I want to add a row after row 5 (in position 6). I would think to keep these numbers sequential with no gaps. Is that right? I have tried:\[code\]ALTER TABLE data DROP id;\[/code\]\[code\]ALTER TABLE data ADD id int(10) AUTO_INCREMENT;\[/code\]I know that's not a good thing. Besides, when testing, it didn't keep my data in order.Any ideas on managing a display order? Am I going to have to load all data into an array and manage it there? Seems like MySql would have a solution already???
 
Back
Top