用表格显示数据问题
最近刚接触php,对函数啊,语法什么的都不太熟,只能靠读别人的程序来摸索
请教各位,帮我看看下面的代码,我想用表格显示从数据库里面读出的内容,这么写不行(是从网上看的)
应该怎么写才对呢?谢谢各位了
<table width="561" border="0" cellpadding="1">
<tr bgcolor="#408080">
<td width="107"><div align="center">文件名</div></td>
<td width="112"><div align="center">中文名</div></td>
<td width="149"><div align="center">路径</div></td>
<td width="97"><div align="center">内容</div></td>
<td width="74">所属栏目</td>
</tr>
<?
$connt=mssql_connect("nenuzhou","sa","");
mssql_select_db("VServiceManager",$connt) or die ("不能连接到数据库!");
$strSql="select V_FileName,V_Name,V_FilePath,V_Text,P_Id from VoiceFile where P_Id='2'";
$result=@mssql_query($strSql);
while($row=mssql_fetch_row($result))
{
$filed1=$row["V_FileName"];
$filed2=$row["V_Name"];
$filed3=$row["V_FilePath"];
$filed4=$row["V_Text"];
$filed5=$row["P_Id"];
?>
<tr>
<td>$filed1</td>
<td>$filed2</td>
<td>$filed3</td>
<td>$filed4</td>
<td>$diled5</td>
</tr>
</table>
<?
}
mssql_close($connt);
?>