$row=mysql_fetch_array($res);//you will only get the first result here for($i=1;$i<=7;$i++) { for($j=1;$j<=$total;$j++) { $tname = 'zonghe'.$i; $$tname += $row["yejin1_".$i];// += is a mathematic operator if(!($row=mysql_fetch_array($res))) // if the configure is correct, it // will always be true $j=$j+1; //you did it upper } echo $$tname."<br>"; }
And from the all program, I really can't see what you want.
{
for($j=1;$j<=$total;$j++)
{
$tname = 'zonghe'.$i; $$tname += $row["yejin1_".$i];// += is a mathematic operator if(!($row=mysql_fetch_array($res))) // if the configure is correct, it
// will always be true $j=$j+1; //you did it upper
}
echo $$tname."<br>";
}