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 RAND() LIMIT 7' at line 1SELECT * FROM adherents WHERE 1 AND supprime=0 AND visible_1=1 AND fichier<>"" AND id IN () ORDER BY RAND() LIMIT 7