Hi there
In mysql I have a table with like 20 rows (example). I want to write sort order (it is in array that carried picID's) to the SORT column from 1 to x (x is the number of items in this example x=20).
My array starts with: [10,15,1...]
I can do:
UPDATE table SET sort=1 WHERE picID=10
UPDATE table SET sort=2 WHERE picID=15
UPDATE table SET sort=3 WHERE picID=1
...
till 20...
But that makes 20 updates to mysql table...
Is it possible to do it any more efficient way?
Jerry