I have a field in my database called "order" and it represents the order in which images are displayed on the page. The order of the images is edited by the user, so after importing them, the user can change them. So let's say that I have these orders ordered like 1,2,3,4,5,6,7,8 .... and the user moves the image in the eighth position to the third position .... is there any SQL update all other entries to move one position up without reading each element in PHP, editing them and then returning them?
So, in this case, the images in positions 1 and 2 remain unchanged .... 8 becomes 3 ... 3 becomes 4, 4 becomes 5, etc.
Craig source
share