salve ho questo codice qui:
codice:
<?php
$c=mysql_connect("localhost","root","stage");
$s=mysql_select_db("stage");
$a1= $_POST["aaaa1"];
$a2= $_POST["aaaa2"];
$m1= $_POST["mm1"];
$m2= $_POST["mm2"];
$g1= $_POST["gg1"];
$g2= $_POST["gg2"];
$inizio= "$a1-$m1-$g1";
$fine= "$a2-$m2-$g2";
$filename = "sheet.xls";
header ("Content-Type: application/vnd.ms-excel");
header ("Content-Disposition: inline; filename=$filename");
?>
<table border="1">
<tr><td>Data</td></tr>
<tr><td>Da:</td><td>A:</td></tr>
<tr><td><?php echo($inizio) ?></td><td><?php echo($fine) ?></td></tr>
</table>
</br></br>
<?php
$qprogetti="Select p.Nome
From giornata g, Progetto p
Where
g.Data >= '$inizio' AND g.Data <= '$fine'AND
g.IDProgetto=p.IDProgetto
group by (p.IDProgetto)";
$resprogetti= mysql_query($qprogetti) or die(mysql_error());
echo "<table border=1>";
$riga="<tr>";
$riga.="<td>Progetto</td>";
$riga1="<tr><td>tot. h/oper</td>";
$qutenti="select Username, sum(Ore) as ore
from giornata
where data>='$inizio' AND data<='$fine'
group by (Username)";
$resutenti=mysql_query($qutenti);
while($utenti= mysql_fetch_array($resutenti)){
$utente=$utenti["Username"];
$oreutente= $utenti["ore"];
$riga.="<td>$utente</td>";
$riga1.="<td>$oreutente</td>";
}
$riga1.="</tr>";
$riga.="<td>Tot. h/g</td></tr>";
echo $riga;
$riga="";
while($progetti=mysql_fetch_array($resprogetti)or die(mysql_error())){
$progetto=$progetti["Nome"];
$riga.="<tr><td> $progetto </td>";
$resutenti=mysql_query($qutenti);
$conta=0;
while($utenti= mysql_fetch_array($resutenti)){
$utente=$utenti["Username"];
$query="select sum(g.Ore) as ore
from Progetto p, Giornata g
where p.Nome='$progetto'
AND g.Username='$utente'
AND g.Data >= '$inizio' AND g.Data <= '$fine'
AND g.IDProgetto=p.IDProgetto
group by(g.Username)";
$result=mysql_query($query);
$ores=mysql_fetch_array($result);
$ore=$ores["ore"];
$conta+=$ore;
$ore=number_format($ore,2,',','');
$riga.="<td>".$ore."</td>";
}
$conta=number_format($conta,2,',','');
$riga.="<td>$conta</td></tr>";
echo "$riga ";
$riga="";
}
echo"$riga1 "; echo"<tr><td>CAPISCI?</td></tr>";
echo "</table>";
?>
mi chiedo: come mai la $riga1 non viene stampata?
grazie in anticipo