您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息
三六零分类信息网 > 松原分类信息网,免费分类信息发布

如何通过php实现实用的分页类

2024/2/17 23:54:09发布23次查看
php中的实用分页类
<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实现实用的分页类的详细内容。
松原分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录