header('Content-Type: application/json; charset=utf-8'); $hostname = "localhost"; $dbusername= "vdvhlglu_mdrive"; $password= "Dm#=7#}yd&AG"; $database= "vdvhlglu_microdrive"; $con=mysqli_connect($hostname,$dbusername,$password,$database); $name = $_GET['n']; $mobile = $_GET['m']; $village = $_GET['v']; $union = $_GET['u']; $thana = $_GET['t']; $district = $_GET['d']; $sql = "SELECT *FROM mdrive ORDER BY id DESC"; $result = mysqli_query($con,$sql); $rowCount = mysqli_num_rows($result); $data = array(); foreach ($result as $item){ $name = $item['Name']; $mobile=$item['Mobile']; $village=$item['Village']; $union = $item['Union']; $thana = $item['Thana']; $district = $item['District']; $mdrive['name'] = $name; $mdrive['mobile'] = $mobile; $mdrive['village'] = $village; $mdrive['union'] = $union; $mdrive['thana'] = $thana; $mdrive['district']= $district; array_push($data,$mdrive); } echo json_encode($data); ?>