<?php
include './config.php';
$longitude=$_POST['longitude'];
$latitude=$_POST['latitude'];
$category=$_POST['category'];



$ssqqlldistance="SELECT *, ( 3959 * acos( cos( radians('$latitude') ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians('$longitude') ) + sin( radians('$latitude') ) * sin(radians(`latitude`)) ) ) AS distance FROM tbl_users_freenumber    HAVING distance < 50 ORDER BY distance ";
    $resultdatadistance =$con->query($ssqqlldistance);
 
    $result=array();
   while($rowdistance=mysqli_fetch_array($resultdatadistance))
    {
       $result[]=$rowdistance; 
    }
     if(count($result) > 0)
    {
        echo json_encode(array("status"=>'101',"message"=>'data found',"data"=>$result));
    }
    else
    {
        echo json_encode(array("status"=>'404',"message"=>'data not found',"data"=>$result));
    }
?>