时间:2021-07-01 10:21:17 帮助过:4人阅读
<table width="100%" border="1" cellpadding="0" cellspacing="0"> <tr> <td>地区代号</td> <td>地区名称</td> <td>父级代号</td> </tr> <?php include("LZY.class.php"); $db = new LZY(); include("page.class.php"); //查总条数 $sz = "select count(*) from chinastates"; $az = $db->Query($sz); //1.造对象 $page = new Page($az[0][0],10); //2.将分页类的limit变量拼接在SQL语句后面 $sql = "select * from chinastates ".$page->limit; $arr = $db->Query($sql); foreach($arr as $v) { echo "<tr> <td>{$v[0]}</td> <td>{$v[1]}</td> <td>{$v[2]}</td> </tr>"; } ?> </table> <?php //3.输出分页信息 echo $page->fpage(); ?> </body>
以上就是如何通过php实现实用的分页类的详细内容,更多请关注Gxl网其它相关文章!