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

19 lines
687 B
PHP

<?php
include "../../ConnectDB.php";
$id = $_REQUEST["id"];
$sql = "SELECT attraction.attraction_id, name,location,open_time,close_time,open_day,close_day,attraction_type.attraction_type_name,price,descrip,attraction_type.attraction_type_image
FROM attraction JOIN attraction_type USING(attraction_type_id)
WHERE attraction_id=".$id;
$result = $conn->query($sql);
$attractionDetail = array();
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$row["attraction_type_image"] = base64_encode($row["attraction_type_image"]);
$attractionDetail [] = $row;
}
} else {
$attractionDetail [] = "No result";
}
echo json_encode($attractionDetail);
?>