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 a.fecha_noticia <= '2024-10-31' ORDER BY a.fecha_noticia desc, a.id_not...' at line 1