Consulta Invalida: 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 fecha desc limit 6' at line 1 En esta parte de la consulta: select id, id as idnota, cabeza, por, sinopsis, fecha from noticias where 1 and habilita=1 and seccion=6 and id!= order by fecha desc limit 6;