Initial Commit
This commit is contained in:
34
indexes/user/getInfo/getHoInfo.php
Normal file
34
indexes/user/getInfo/getHoInfo.php
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
<?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);
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user