Menu
So I’m doing one of those drag and drop re-ordering systems but I’m having problem with the query. It works fine if I drag an item only one row down, but if I drag it further down, the order gets messed up. So for example switching from 1-2-3-4 to 2-1-3-4 works, but going to 4-1-2-3 does not.
Here’s my query:
update schedule set sortOrder = ” . $newOrder[$count] . “, modified = 1 where sortOrder = ” . ($count + 1) . ” and modified = 0
the modified column is to make sure I don’t update the same entry twice. I set them all back to 0 after all updates are done. Any visible problems?