[eluser]GregX999[/eluser]
I need to select the images in a specific order so I can iterate through them and update their "position" field. The position field is used to order them when they are being displayed. I'm using drag-n-drop sorting w/ AJAX so an admin can sort them, and when an item is drag-dropped, the new sequence is sent through AJAX. And since there are multiple pressitems, I only want to re-sequence the images that belong to the item being edited.
So I ended up going with this:
Code:
$pressimage->query("SELECT * FROM pressimages WHERE pressitem_id={$pressitem->id} ORDER BY FIELD(id,{$images_in_order})");