I have this...
Code:
SELECT d.id AS id, d.name AS name, i.url AS image_url
FROM destinations d, cities c, destination_images i
WHERE d.id IN (1,2,3) AND d.closest_city_id = c.id AND i.is_primary_photo = 1
ORDER BY FIND_IN_SET(d.ID, '1,2,3');
Now I destination_images has many photos with is_primary_photo with 1. It returns all. I just want the first one.
Thanks.