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 'e-f547-3b67-65d37df9b977.jpg = 1) AND tipo IN (18) AND provincia IN (460) orde' at line 1 Error en buscarLibre. Consulta: select * from m_inmuebles where terminado=1 and estadoOp='Activo' and visible_web=1 AND (nave-en-venta-349000-euros-las-rozas-de-madrid_57ac89f5-8e6e-f547-3b67-65d37df9b977.jpg = 1) AND tipo IN (18) AND provincia IN (460) order by escaparate desc, nave-en-venta-349000-euros-las-rozas-de-madrid_57ac89f5-8e6e-f547-3b67-65d37df9b977.jpg desc, tipo asc, fecha desc, id