SELECT i.`id`, i.`name`, i.`breed`, i.`color`, i.`gender`, i.`kitten_status`, i.`kitten_status_text`, i.`litter_id`, (SELECT `photo_medium` FROM `animals_photos` WHERE `animal_id`=i.`id` AND `main`=1 LIMIT 0,1) as `photo` FROM `animals_items` i WHERE i.`litter_id` IN () ORDER BY i.`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 i.`id` ASC' at line 6