I have my location's coordinates and I want to sort the coordinates of my database from nearest to farther from my location. This is my code to take and save the coordinates:
$myXCoor = 37.9730328;
$myYCoor = 23.7533623;
$xcoor = array();
$ycoor = array();
$result = mysqli_query($con, "SELECT * FROM `base`.`table` ;");
while($row = mysqli_fetch_array($result, MYSQLI_BOTH))
{
$xcoor[] = $row['x'];
$ycoor[] = $row['y'];
}
I really don't how can I go on, If someone want any more details please leave a comment.
Thanks in advance