Initial Commit
This commit is contained in:
37
indexes/user/getInfo/getFoInfo.php
Normal file
37
indexes/user/getInfo/getFoInfo.php
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
<?php
|
||||
include "../../ConnectDB.php";
|
||||
$id = $_REQUEST["id"];
|
||||
$sql = "SELECT
|
||||
restaurant.restaurant_id,
|
||||
restaurant.name AS rname,
|
||||
cities.name AS cname,
|
||||
restaurant.location,
|
||||
restaurant.open_day,
|
||||
restaurant.close_day,
|
||||
restaurant.open_time,
|
||||
restaurant.close_time,
|
||||
restaurant.rating,
|
||||
restaurant_style.restaurant_style_name,
|
||||
restaurant.descrip,
|
||||
restaurant.fee,
|
||||
restaurant_style.restaurant_style_image AS image
|
||||
FROM
|
||||
restaurant
|
||||
JOIN
|
||||
cities ON restaurant.city_id = cities.id
|
||||
JOIN
|
||||
restaurant_style ON restaurant.restaurant_style_id = restaurant_style.restaurant_style_id
|
||||
WHERE restaurant_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