prova così.Codice PHP:
$quantita = array();
for ($b=0; $b<$totdistinte; $b++) {
$cerca = mysql_query("SELECT qtacod FROM $dibart WHERE dibcod '$distinte[$b]' AND codpro = '$codici[$a]'");
if(mysql_num_rows($cerca) > 0 ) {
while($row2 = mysql_fetch_array($cerca)) {
$quantita[] .= $row2['qtacod'];
}
}
elseif(mysql_num_rows($cerca) == 0 ) {
$quantita[] .= '00';
}
}
![]()