I'm currently creating a Flash CMS via Flex and the Zend Framework. In the Flex interface, I have a list of drag-able items pulled from a MySQL database via the Zend Framework. The user can rearrange the items by dragging and dropping them which will change their order in the mapped Flex array.
Back on the server I have a column in my "items" table called "order" that keeps track of the items' order for presentation purposes. So my question is what is the most efficient way of updating my changes in the "order" column of my database?
I know I could just iterate through the entire array and run an update query on every row, updating the order value to the value of the counter/iterator, but that seems a bit ugly, I may not need to update every row, and I could potentially be firing a lot of queries very quickly to MySQL.
Any idea would be greatly appreciated.
Thanks for looking. :)