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