我试图从不断重演,因为在循环在相同的数据停止下表中的数据,崩溃的浏览器:停止连续表生成
这里的查询:
$posts = mysqli_fetch_assoc(mysqli_query($db, "SELECT * from tbl_bugresponse WHERE bugid = $id ORDER BY time"));
这里的表代码:
<table width="100%" class="tborder">
<tr>
<th class="tcat">Name</th>
<th class="tcat">Reply</th>
</tr>
<?php
$colour="1";
while($posts) {
if($colour == "1"){
echo ("<tr class='alt1'>");
$f1 = $posts['by'];
$f2 = $posts['content'];
$colour = "2";
}
else {
echo "<tr class='alt2'>";
$f1 = $posts['by'];
$f2 = $posts['content'];
$colour = "1";
}
?>
<td><?php echo $f1; ?></td>
<td><?php echo $f2; ?></td>
</tr>
<?}?>
</table>
请注意,我使用mysqli不是mysql。
我会如何把该代码? – bear 2009-06-08 21:29:12