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 'dc7cad75.jpg = 1) AND tipo IN (21, 25, 22, 26, 14, 2, 24) AND provincia IN (460)' at line 1 Error en buscarLibre. Consulta: select * from m_inmuebles where terminado=1 and estadoOp='Activo' and visible_web=1 AND (casa-baja-259000-euros-las-rozas-de-madrid-zona-centro_thumb11d6f488-cf87-c8d3-424f-65e0dc7cad75.jpg = 1) AND tipo IN (21, 25, 22, 26, 14, 2, 24) AND provincia IN (460) order by escaparate desc, casa-baja-259000-euros-las-rozas-de-madrid-zona-centro_thumb11d6f488-cf87-c8d3-424f-65e0dc7cad75.jpg desc, tipo asc, fecha desc, id