[thelist] MySQL/PHP design question : order in a DB table.

rudy rudy937 at rogers.com
Wed Jul 23 04:51:40 CDT 2003


> The best I could think off is to create a column called 'ordered', and
> put a number in it for each row : 1, 2, 3, etc.
> The problem is each time I want to change the order (increment or
> decrement the number), I have to check all the other siblings to see if
> there is any overlap. 
>
> Does anyone have a more elegant and simple design ?


oh, you're pushing all my buttons with a question like that 

elegant and simple go hand in hand   

 ;o)



don't assign the values consecutively

your list with saner 'ordered' values --

    20 Aaa
    40 Bbb
    60 Ccc

becomes

    17 Bbb
    20 Aaa
    60 Ccc


rudy


More information about the thelist mailing list