I try to fix your program, but I see there are too many errors in it and this just make me donot understand what you want.

解决方案 »

  1.   

    $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>";
      }
      

  2.   

    And from the all program, I really can't see what you want.