Thanks for the info 7KHAT.
I'm not sure if I'm being completely clear. I'm quite familiar with the order by and even array sorting. I guess what I am looking for is storing sort orders...
What I've been trying to explain is that I HAVE a sort column - and I store the number of each item.
My problem is:
1) everytime i want to move Item 1 below Item 6 I have to do 2 writes to the database and reload my page so that the user can see its done.
2) If I add a record to the database I have to move all items down and add the new record to the top (i.e. add one to all sort orders and insert a record with 1 on the sort order).
this proves problematic if more than one person is on the system at once. Mainly because if I move item 1 below item 6 and you're logged in at the same time and move item 6 above item 4 - we will not get the expected results.
One thing I've been thinking about is writing a single sort order in another table that simply orders the record ids (2,3,4,6,1,7,10,9). Then having javascript pop and push items into an array back and forth. When they are happy with the items they do one single write to the db column. Although there seem to be complication and problems with this too.
any other ideas? thansk everyone for their help
sm