This is pretty general - I'm looking for suggestions on how people allow users to custom sort lists - and not sort by columns but physically move Item 6 above Item 1 and Item 2 below Item 10 etc.
Currently I've created an sort column in the tables that I want sorted and given each item a sort number. If i want to move Item 1 below Item 6 ... i do 2 queries:
1) subtract 1 from everything with sort order <=6's
2) renumber item #1's sort order to #6
Of course if I was moving #6 to #1's spot it would be adding 1 to everything and then renumbering it the other way.
Anyway... does anyone have a better method of performing this kind of custom sorting? I've thought about keeping a sort order array or something like that but that doesn't cut down the amount of queries I perform.
sm