Advertisement
lala6666

wrong

Aug 4th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. include('con.php');
  4.  
  5. $nama=$_GET['nama'];
  6.  
  7. $response = array();
  8.  
  9. $query = "SELECT * FROM datasekolah where nama like '%$nama%'";
  10.  
  11.  
  12.  
  13. $result = mysqli_query($con, $query);
  14.  
  15. while($row = mysqli_fetch_array($result)){
  16.  
  17. $tmp = array();
  18.  
  19.  
  20.  
  21. $tmp["lat"] = $row['latitude'];
  22. $tmp["lng"] =$row['longitude'];
  23. $tmp["id"] = $row['id'];
  24. $tmp["nama"] = $row['nama'];
  25. $tmp["nama"] = $row['nama'];
  26. array_push($response, $tmp);
  27.  
  28. }
  29.  
  30.  
  31.  
  32.  
  33. header('Content-Type: application/json');
  34. echo json_encode($response);
  35.  
  36.  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement