0) { /********************************************************************************************************* * dato l'id dell'agente mi recupero i clienti di questo agente *********************************************************************************************************/ $ql = " SELECT F.IdFornitori, F.Nome FROM fornitori F inner join ordini O on O.idfornitore = F.idfornitori and O.Anno = $anno and O.idagente = $id_agente order by Nome " ; } else { $ql = " SELECT DISTINCT F.IdFornitori, F.Nome FROM fornitori F order by Nome " ; } break ; default: $ql = "" ; } debug(0, "QUERY = $ql") ; $str_res = '' ; list($nl, $dl) = $db->RecuperaDati($ql) ; for ($i = 0; $i < $nl; $i++ ) { $idfor = $dl["IdFornitori"][$i] ; if (! in_array($idfor, $arrIdFor)) { $arrIdFor[] = $idfor ; $str_res .= $idfor . '^' . $dl["Nome"][$i] . ';' ; } } // ritorna il risultato echo $str_res ; ?>