SELECT i.`id`, i.`name`, i.`title`, i.`color`, p.`photo_small` as `photo` FROM `animals_items` i LEFT JOIN `animals_photos` p ON (p.`animal_id`=i.`id` AND p.`main`=1 AND p.`active`=1) WHERE i.`id` IN () ORDER BY `id` ASC
id
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY `id` ASC' at line 10