Ho risolto così
$query = "SELECT l.localita AS X,count(c.localita_id) as quanti
from fusion_clienti c
inner join fusion_localita l on c.localita_id = l.id
group by c.localita_id
order by quanti desc";
$result = dbquery($query);
if (dbrows($result) != 0) {
while($data = dbarray($result)) {
echo $data['X'].' - '.$data['quanti'].'
';
}
}
adesso provo a mettere anche le altre due tabelle.![]()
![]()