How to sort by the smallest number of my table with data that comes from an api?
<?php
$query = $mysqladv->query("SELECT * FROM advogados_aux WHERE adv_idunico='$idadvun';");
while($row = $query->fetch_array()){
$url = "https://maps.googleapis.com/maps/api/distancematrix/json?origins=".$row['adv_cep']."&destinations=".$c_cep."&language=pt&mode=car&key=AIzaSyDL6_dJ-Mbi_03_g6lHhWibxY22Z2UeYZQ";
$json = file_get_contents($url);
$json_data = json_decode($json, true);
$distancia = $json_data['rows'][0]['elements'][0]['distance']['value'];
?>