I have a table of data pulled from a mysql database with each row being a different record.
I have a script where the user can drag a row into a different order and that script will pass into back to a php script to update the database.
I'm lost at how to set up my fields for my custom ordering.
Lets say I have these record numbers
1
2
3
4
5
And the user drags record 5 before record three to make the order this
1
2
5
3
4
How would I go about updating my database to that new order? I've thought about some sort of "sort" field, but still not sure how to update the values properly.
Any ideas are appreciated.