I want to allow users to rearrange items by providing a number. So if there are 5 items
Id, Item, Display Order
1, Item a, 1
2, Item b, 2
3, Item c, 3
4, Item d, 4
5, Item e, 5
users get 5 input boxes and they can provide a number and click update to reorder the items. If user enters 125 as the new position in the above, it just sets it as the max (which is 5) and update the other items, if user enters -10, it just makes that item as 1 and update others.
I just can't figure out how to update the order once the user submits the form. any help would be appreciated. Thanks
UPDATE
Using the data above I present 5 rows to the user with 5 input boxes containting display_order value as the default value. If the user wishes to reorder the list, they can update the input box value and click submit to update the database. I am using ORDER BY displayorder query to list the reocrds.
Any questions please ask
5, in what order are you wanting the items to redisplay? What if the user enters3? What if they enter1?UPDATEquery in SQL? Are you having trouble getting the values from the$_POSTsuperglobal? The root of your question is still quite unclear.