我有一个 while 循环,它在表中显示记录。工作正常,但表格顶部有一个额外的表格行,它是空的。
<table width="100%" border="0" cellpadding="5">
<?php do {
$count++;
?>
<tr bgcolor=<?php echo processRow($count); ?>>
<td><?php echo $row['title']; ?></td>
<td width="8%"><a href="edit_topic.php?topic_pk=<?php echo $row['topic_pk']; ?>">edit</a></td>
<td width="12%"><a href="edit_topic.php?topic_pk=<?php echo $row['topic_pk']; ?>">delete</a></td>
</tr>
<?php
if($count == 2){
$count = 0;
}
} while ($row = mysql_fetch_assoc($result));
?>
</table>