Ciao, come faccio a inserire 00 se la query non da alcun valore?
Così non mi funziona!
Codice PHP:
for ($b=0; $b<$totdistinte; $b++)
{
$cerca = mysql_query("SELECT qtacod
FROM $dibart
WHERE dibcod = '$distinte[$b]'
AND codpro = '$codici[$a]'
");
while($row2 = mysql_fetch_array($cerca))
{
if ($row2['qtacod'] != ""):
$quantita[] = $row2['qtacod'];
else:
$quantita[] = "00";
endif;
}
}