发新话题
打印

【求助】表格输出的问题

【求助】表格输出的问题

新手,刚学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 编辑 ]
附件: 您所在的用户组无法下载或查看附件

TOP

引用:
echo mysql_result($result, $i, 'slsj');
echo "</tr></br></n>";
}
echo "</table>";
?>
echo "</tr></br></n>"; 呵呵
努力为phpres做贡献
时刻准备着,当机会来临时你就成功了
打好基础,增加社会经验
资深技术工程师是我的梦想
承接各种团体网站外包服务和各种it技术培训
准备申请AJAX版大,希望大家支持~~

TOP

发新话题