Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once "koneksi.php";
- header('Content-Type: application/json');
- if($_SERVER['REQUEST_METHOD']=='POST') {
- $search = $_POST['search'];
- $sql = "SELECT * FROM tbrs where nama LIKE '%$search%' and bpjs = '1'";
- $res = mysqli_query($con,$sql);
- $result = array();
- while($row = mysqli_fetch_array($res)){
- array_push($result, array('nama'=>$row[1], 'gambar'=>$row[2], 'lat'=>$row[3], 'lng'=>$row[4], 'detail'=>$row[5]));
- }
- echo json_encode(array("value"=>1,"result"=>$result));
- mysqli_close($con);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement