I have a list of items in a MySQL table.
The user is able to order these items by dragging them up and down in a HTML list.
I then need to store each items position in the list.
Is it possible to do this in one MySQL call or does it have to be a seperate call for each product to set its own order ID?
A single call would look something like this:
UPDATE table_name SET `order` = order_number AND `product_id` = 'X';
Well, you could drop the whole table and then insert the new order numbers for all products. That’s only two statements. This would work as long as this table only contains the “order” information and no other critical data.