导不出数据库的数据
<?php
include("conn.php");
//传入页码
$page=$_POST[p];
//设置数据库编码格式
mysql_query("SET NAMES UTF8");
$sql="SELECT * FROM chengji LIMIT".($page-1)*3 . ",3";
//把sql语句传送数据中
$result=mysql_query($sql);
echo" <table border=1 cellspacing=0 >";
echo"<tr><td>学号</td><td>课程号</td><td>课程名</td><td>成绩</td><td>学分</td></tr>";
while($row=mysql_fetch_assoc($result)){
echo "<tr>";
echo "<td>{$row['sno']}</td>";
echo "<td>{$row['cno']}</td>";
echo "<td>{$row['cname']}</td>";
echo "<td>{$row['xuefen']}</td>";
echo "</tr>";
}
echo "</table>";
mysql_free_result($result);
mysql_close($link);
$page_banner="<a href='".$_SERVER['PHP_SELF']."?p=".($page-1) ."'>上一页</a>";
$page_banner="<a href='".$_SERVER['PHP_SELF']."?p=".($page+1) ."'>下一页</a>";
echo $page_banner;
?>
导不出数据库的数据,请问是为什么呢?谢谢