Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Content-Type: application/json');
- require_once('koneksi.php');
- $url_maps="http://maps.googleapis.com/maps/api/staticmap?zoom=17&size=800x300&maptype=roadmap&markers=icon:http://cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico|
- ";
- $response = array();
- $sql = "select * from tbl_restoran";
- $result = $con->query($sql);
- $arr = array();
- if ($result->num_rows > 0) {
- while($row = $result->fetch_assoc()) {
- $arr[] = array(
- 'id_restoran' => "" . $row["id_restoran"]. "",
- 'nama_restoran' => "" . $row["nama_restoran"]. "",
- 'url' => "$url_maps" . $row["lat"]. ",".$row["lng"]."");
- }
- echo '{ "data":';
- echo json_encode($arr, JSON_PRETTY_PRINT);
- echo '}';
- }
- $con->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement