RoamEase/indexes/user/getInfo/getHoInfo.php
2025-06-06 17:31:03 +08:00

35 lines
815 B
PHP

<?php
include "../../ConnectDB.php";
$id = $_REQUEST["id"];
$sql = "SELECT
hotel.hotel_id,
hotel.location,
hotel.name AS 'hname',
hotel_room_type.room_type_name AS 'rType',
hotel_room.price AS 'price',
hotel_room.hotel_room_id,
hotel.descrip,
hotel_type.hotel_type_image AS image
FROM
hotel
JOIN
hotel_room ON hotel.hotel_id = hotel_room.hotel_id
JOIN
hotel_room_type ON hotel_room.room_type_id = hotel_room_type.room_type_id
JOIN hotel_type USING(hotel_type_id)
WHERE hotel.hotel_id=".$id;
$result = $conn->query($sql);
$attractionDetail = array();
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$row["image"] = base64_encode($row["image"]);
$attractionDetail [] = $row;
}
} else {
$attractionDetail [] = "No result";
}
echo json_encode($attractionDetail);
?>