Errore data_elenco_result SELECT foto_nome,foto_ext,foto_style,id_foto_tipo,id FROM foto WHERE id_foto_categorie=2 AND id_custom= AND foto_ext='webp' GROUP BY foto_nome ORDER BY num DESC: 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 foto_ext='webp' GROUP BY foto_nome ORDER BY num DESC' at line 1