0
How to sort by the smallest number 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'];
?>
ORDER BY ASC or DESC variable at the end of the query does not work? Which variable do you want to sort?
– White
I want to order by $distance
– João Pedro Morais
ORDER BY Distance ASC or DESC does not work?
– White
that data is not coming from the database! ai do not know how to do!
– João Pedro Morais