You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') and actif='oui' and genre_id='1' order by FIELD (id,,)' at line 1 select * from stocks_visuel_stocks where id IN (,) and actif='oui' and genre_id='1' order by FIELD (id,,)