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 'and seccion='' and seccion!='portada' and seccion!='' and activo='s' and estado=' at line 1select * from ediciononline where idnoticia!= and seccion='' and seccion!='portada' and seccion!='' and activo='s' and estado='finalizada' and fecha>'2018-10-01' order by orden limit 50