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 '.0.custom.js = 1) AND tipo IN (7) AND provincia IN (460) order by escaparate d' at line 1 Error en buscarLibre. Consulta: select * from m_inmuebles where terminado=1 and estadoOp='Activo' and visible_web=1 AND (jquery-ui-1.9.0.custom.js = 1) AND tipo IN (7) AND provincia IN (460) order by escaparate desc, jquery-ui-1.9.0.custom.js desc, tipo asc, fecha desc, id