I need a script (php) for sorting images.
Example: I have a mysql database with several hundred thousand of images. Every image have a unique id. Let's pretend that I want to move image with id 345, 346, 400 to position 5, 6, 7. Is there a easy method for doing that kind o things? I have searched all over the net and found this:
SELECT * FROM table name ORDER BY FIND_IN_SET(fieldname, 'x,x,x,x,345,346,400,x,x,x,x,x')
Looks interesting but I want to know if there are better ways. I am unsure if FIND_IN_SET can handle several hundred thousand of images. It will be a very long comma terminated list of numbers :-)
Is it possible to use a sortfield where I can manipulate the values and then order by sortfield? I really need help to go in the right direction.