<?php

include('db_connect.php');
$response=array();
if(isset($_GET['uid'])){
$uid=$_GET['uid'];
$query="Select * from device_reg where uid='$uid'";
$result= mysqli_query($con,$query);
if(mysqli_num_rows($result)>0){
while($row=mysqli_fetch_assoc($result)){
    $response[]= $row;
}
}else{
    $response['error']=true;
    $response['message']="No such record exists against this id: ".$uid;

}
}else{
    $response['error']= true;
   $response['message']="Some error occured. Please try again!";
}

echo json_encode($response);
mysqli_close($con);

?>