/home/desid573/public_html/gcdriver
Edit: /home/desid573/public_html/gcdriver/array.php (2200B)
query($sql);
if(!$success) {
echo $conn->error;
}*/
$data["city"] = $row["city"];
$data["array"] = unserialize($row["array"]);
$data["airport"] = $row["airport"];
array_push($array, $data);
}
$query = "SELECT * FROM terminal_details";
$result = mysqli_query($conn, $query);
$new = array();
$city = array();
while($row = mysqli_fetch_assoc($result)) {
$cityArray = $city[$row["city"]];
$thisArray = array("name" => $row["name"], "buttonLabel" => $row["buttonLabel"], "lat" => $row["lat"], "long" => $row["long"]);
if($cityArray == null) {
$city[$row["city"]] = [$thisArray];
} else {
array_push($cityArray, $thisArray);
$city[$row["city"]] = $cityArray;
}
}
$query = "SELECT * FROM prices";
$result = mysqli_query($conn, $query);
$price = array();
while($row = mysqli_fetch_assoc($result)) {
array_push($price, $row);
}
$response["status"] = "ok";
$response["areas"] = $array;
$response["terminals"] = $city;
$response["prices"] = $price;
echo json_encode($response, true);
?>