SELECT * FROM alojamientos WHERE (pagado = 1 OR CURDATE() - INTERVAL 5 DAY <= fecha_registro) AND idciudad = AND destacado=1 ORDER BY rand() limit 3SELECT * FROM alojamientos WHERE (pagado = 1 OR CURDATE() - INTERVAL 5 DAY <= fecha_registro) AND idciudad IN (select id from ciudades WHERE idcircuito = ) AND destacado=1 ORDER BY rand() limit 4