数据库里面明明有数据,它就是死活显示不了,代码我重复看了好几遍了。我觉得应该没有错了啊,为什么就是显示不出来呢??大家帮忙看看到底哪里不对啊?<?php
$conn=mysql_connect("localhost","root","");
mysql_select_db("lyb",$conn);
mysql_query("set names 'utf8'");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>留言本</title>
</head>
<body>
<table width="30%" border="0" align="center" cellpadding="5" cellspacing="1">
<?
$sql="select * from ly order by id desc";
$jieguo=mysql_query($sql,$conn);
while($row=mysql_fetch_array($jieguo))
{
?>
<tr>
<td> </td>
<td> </td>
<td><a href="add.php">发表留言</a></td>
</tr>
<tr>
<td>标题:<?=$row[bt]?></td>
<td>作者:<?=$row[zz]?></td>
<td>时间:<?=$row[sj]?></td>
</tr>
<tr>
<td colspan="3"><?=$row[nr]?></td>
</tr>
<?
}
?>
</table>
</body>
</html>
$conn=mysql_connect("localhost","root","");
mysql_select_db("lyb",$conn);
mysql_query("set names 'utf8'");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>留言本</title>
</head>
<body>
<table width="30%" border="0" align="center" cellpadding="5" cellspacing="1">
<?
$sql="select * from ly order by id desc";
$jieguo=mysql_query($sql,$conn);
while($row=mysql_fetch_array($jieguo))
{
?>
<tr>
<td> </td>
<td> </td>
<td><a href="add.php">发表留言</a></td>
</tr>
<tr>
<td>标题:<?=$row[bt]?></td>
<td>作者:<?=$row[zz]?></td>
<td>时间:<?=$row[sj]?></td>
</tr>
<tr>
<td colspan="3"><?=$row[nr]?></td>
</tr>
<?
}
?>
</table>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货