一下是分页代码:
<!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="750" height="63" border="0" align="center">
  <tr>
    <td width="115" align="center" bgcolor="#3399CC">材质编码</td>
    <td width="145" align="center" bgcolor="#3399CC">材质名称</td>
    <td width="156" align="center" bgcolor="#3399CC">所属产品分类编码</td>
    <td width="66" align="center" bgcolor="#3399CC">排序号</td>
    <td width="194" align="center" bgcolor="#3399CC">备注</td>
  </tr>
  <?php 
include ("conn.php");
$sql = mysql_query("select * from tbl_material order by id desc" , $conn);
$info = mysql_fetch_array($sql);
if ($page==""){
$page = 1;
}
if (is_numeric($page)){
$page_size=5;
$query = "select count(*) as total from tbl_material order by id desc";
$result = mysql_query($query);
$message_count = mysql_result($result,0,"total");
$page_count = ceil($message_count/$page_size);
$offset = ($page-1)*$page_size;
$sql = mysql_query("select * from tbl_material order by id desc limt $offset,$page_size");
$row = mysql_fetch_object($sql);
if (!$row){
echo "<font color='red'> 暂无材质信息!</font>";
}
do{
        ?>
  <tr>
    <td align="center" bgcolor="#CCFFFF"><?php echo $row->mtSN;?></td>
    <td align="center" bgcolor="#CCFFFF"><?php echo $row->mtName;?></td>
    <td align="center" bgcolor="#CCFFFF"><?php echo $row->mtStSN;?></td>
    <td align="center" bgcolor="#CCFFFF"><?php echo $row->mtOrder;?></td>
    <td align="center" bgcolor="#CCFFFF"><?php echo $row->mtMemo;?></td>
  </tr>
  <?php
   }while ($row = mysql_fetch_object($sql));
 
 }
 ?>
  
</table>
<table width="750" height="30" align="center">
  <tr>
    <td align="center" bgcolor="#CCFFFF">页次:<?php echo $page; ?>/<?php echo $page_count;?>页 记录:<?php echo $message_count;?>条</td>
    <td width="63%" align="right">
    <?php 
if($page!=1){
echo "<a href=page_affiche.php?page=1>首页</a>$nbsp:";
echo "<a href=page_affiche.php?page".($page-1).">上一页</a>$nbsp:";
}
if($page<$page_count){
echo "<a href=page_affiche.php?page=".($page+1).">下一页</a>&nbsp;";
echo "<a href=page_affiche.php?page=".$page_count.">尾页</a>";
}
mysql_free_result($sql);
mysql_close($conn);
?>
    </td>
  </tr>
</table>
</body>
</html>以下是出现的警告:
代码行数: