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 '516¬icia=54,5' at line 1 Consulta: select id_principal,titulo,difusion,entradilla,imagenp,provincia,fecha from noticias where fecha<='2010-02-09 21:38:02' and difusion='1' and fecha_deposito>TO_DAYS(NOW()) and destacado='1' and destacado2='1' and id_principal!=1752 order by fecha desc limit 516¬icia=54,5