SELECT name_photo
FROM p_photo
WHERE type_photo = 'prod'
AND id_target =
ORDER BY tri_photo => 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 tri_photo' at line 5