Si fatto print($query):
codice:
SELECT hot.hotel_id, hot.hotel_name, hot.hotel_stars, hot.hotel_state, hot.hotel_city, hot.hotel_address, hot.hotel_zipcode, hot.longitud, hot.latitud, roomy, disponibles FROM hotels AS hot LEFT OUTER JOIN (SELECT cam.hotel_id, cam.id_camera AS roomy, MAX(cam.numero_camere - IFNULL(bca.cantidad,0)) AS disponibles FROM camere AS cam LEFT OUTER JOIN (SELECT room_type_id, MAX(total_room + blocked_inventory) AS cantidad FROM booking_check_avilability WHERE check_in_date >= '01/05/2015' AND check_out_date <= '05/05/2015' GROUP BY room_type_id) AS bca ON cam.id_camera = bca.room_type_id WHERE cam.numero_ospiti >= '2' GROUP BY cam.hotel_id HAVING disponibles >= '1' ) AS rom ON hot.hotel_id = rom.hotel_id WHERE hot.hotel_city = 'Adrano' AND disponibles >= '1'