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 'b0b-4f102727129d.jpg = 1) AND tipo IN (5) AND provincia IN (460) order by esca' at line 1 Error en buscarLibre. Consulta: select * from m_inmuebles where terminado=1 and estadoOp='Activo' and visible_web=1 AND (_e914f4f6-4b80-508e-8b0b-4f102727129d.jpg = 1) AND tipo IN (5) AND provincia IN (460) order by escaparate desc, _e914f4f6-4b80-508e-8b0b-4f102727129d.jpg desc, tipo asc, fecha desc, id