<?php
include("conn.php");
?>
<table width=500 border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
<?
$sql="select * from message";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query)){
?>
<tr bgcolor="#eff3ff">
<td>标题:<?$row[title]?> 用户:<?$row[user]?></td>
</tr>
<tr bgcolor="#ffffff">
<td>内容:<?$row[content]?></td>
</tr>
<?
}
?>
</table>
<?php
include("conn.php");
?>
<table width=500 border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
<?
$sql="select * from message";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query)){
?>
<tr bgcolor="#eff3ff">
<td>标题:<?$row['title']?> 用户:<?$row['user']?></td>
</tr>
<tr bgcolor="#ffffff">
<td>内容:<?$row['content']?></td>
</tr>
<?
}
?>
</table>
不知道conn.php里是怎么写连接数据库的。。。
改成这样试试
<?php
include("conn.php");
?>
<table width=500 border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
<?
$sql="select * from message";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query)){
?>
<tr bgcolor="#eff3ff">
<td>标题:<?$row[0]?> 用户:<?$row[1]?></td>
</tr>
<tr bgcolor="#ffffff">
<td>内容:<?$row[2]?></td>
</tr>
<?
}
?>
</table>