在下面的循环中,PHP似乎不会将输出的字符串传递回包含它的循环以进行进一步的操作,然后使该循环的输出什么都没有。
请帮我理解为什么。。。
<?php
$finalTablePrint = <html><body style="font-family:Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif; font-size:40px;">
LTU Activity Report<br/>
<span style="font-size:18px;"> Date Created: . date("l jS of F Y") . <br/><br/>
<table width=100% style="background-color:white; font-size:12px; border-collapse:collapse;" >
<tr style="font-size:12px; font-weight:600; background-color:#d2dbdf; height:35px;">
<td>Activity</td><td>Department</td><td>Hours Spent</td><td>Month</td>
</tr> ;
while ($row = mysql_fetch_assoc($result)) {
$finalTablePrint .= <tr><td colspan=4> . $row[ activity ] . </td></tr> ;
while ($row_1 = mysql_fetch_assoc($result)) {
if ($row_1[ activity ] == $row[ activity ] && $row_1[ department ] == $row[ department ]) {
$finalTablePrint .= <tr style="height:30px;"><td colspan=3> . $row[ department ] . </td> . <td> . $row[ hours ] . </td><td> . $row[ month ] . </td></tr> ;
}
}
}
echo $finalTablePrint .= </table><script type="text/javascript">javascript:window.print(); setTimeout( window.location="../../admin/index.php" ,"1000");</script></body></html> ;