<?php

include('db_connect.php');
$response=array();
if(isset($_POST['uid'])){
$uid=$_POST['uid'];
$query="Select * from device_reg where uid='$uid'";
$result= mysqli_query($con,$query);
$row=$result->fetch_all(MYSQLI_ASSOC);
if($row>0){
    $response=array("error"=>"false","message"=>"record recived","data"=>$row);


}else{
    $response=array("error"=>"true","message"=>"unavailable","data"=>$row);
}
}else{
    $response=array("error"=>"true","message"=>"Some error occured. Please try again!");
}

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

?>