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 'b-0f5a-6143818fbf84.jpg = 1) AND tipo IN (5) AND provincia IN (460) order by e' at line 1 Error en buscarLibre. Consulta: select * from m_inmuebles where terminado=1 and estadoOp='Activo' and visible_web=1 AND (local-en-venta-130000-euros-las-rozas-de-madrid-zona-burgo-parque-paris_1fbaa4ab-552e-505b-0f5a-6143818fbf84.jpg = 1) AND tipo IN (5) AND provincia IN (460) order by escaparate desc, local-en-venta-130000-euros-las-rozas-de-madrid-zona-burgo-parque-paris_1fbaa4ab-552e-505b-0f5a-6143818fbf84.jpg desc, tipo asc, fecha desc, id