I am worried I am not doing this correctly. Currently I have implemented a drag and drop interface for a table of database data using jQuery UI's drag and drop functionality. On updating the order, I have a callback function make an ajax call sending the element's position to a php script. Based on the element's position, php recalculates the position of all the other items and updates their positions in the MySQL database.
My fear is that a user could reorder the list too quickly and cause the items in the database to be updated by php before they were finished being updated from the previous request, causing incorrect data. Is this a problem? Should I implement some way to queue up ajax requests until the previous one is complete? I'm wondering if there is some best practice for updating a database with ajax and making sure that the update is complete before updating the same item again.