【求助】表格输出的问题
新手,刚学PHP。现在遇到一个问题,就是查询后输出表格,如果查到N条数据,在表格上方就空N行,不解。
[attach]415[/attach]
下面是代码:
<style type="text/css">
<!--
table { font-size: 11px}
tr {background-color:expression((this.sectionRowIndex%2==0)?"#E4FFEF":"#CCEBC7")}
-->
</style>
</head>
<body>
<table border ="1">
<tr>
<td>编号</td>
<td>日期</td>
<td>时间</td>
</tr>
<?php
$link = mysql_connect("localhost","root","");
mysql_select_db("mydb",$link);
mysql_query("set names gb2312");
$sql = "select * from ccxx where slrq='2007-11-7';";
$result = mysql_query($sql,$link);
for ($i = 0;$i < mysql_num_rows($result);$i++)
{
echo "<tr><Td>";
echo mysql_result($result, $i, 'xtbh');
echo "</td><td>";
echo mysql_result($result, $i, 'slrq');
echo "</td><td>";
echo mysql_result($result, $i, 'slsj');
echo "</tr></br></n>";
}
echo "</table>";
?>
[ 本帖最后由 hzcyl 于 2007-11-16 14:47 编辑 ]
附件: 您所在的用户组无法下载或查看附件