Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- include('con.php');
- $nama=$_GET['nama'];
- $response = array();
- $query = "SELECT * FROM datasekolah where nama like '%$nama%'";
- $result = mysqli_query($con, $query);
- while($row = mysqli_fetch_array($result)){
- $tmp = array();
- $tmp["lat"] = $row['latitude'];
- $tmp["lng"] =$row['longitude'];
- $tmp["id"] = $row['id'];
- $tmp["nama"] = $row['nama'];
- $tmp["nama"] = $row['nama'];
- array_push($response, $tmp);
- }
- header('Content-Type: application/json');
- echo json_encode($response);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement