正文  软件开发 > PHP编程技术 >

php数据库分页,php分页

php数据库分页,php分页<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title<...

php数据库分页,php分页

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<?php
//引入类(分页类10-24博客) require_once "YIN.class.php"; require_once "../t/page.class.php"; $db = new YIN();
//取数据总条数 $zts = "select count(*) from wg"; $sql = $db->StrQuery($zts);
//造对象 $page = new Page($sql,15); //在obj后边加上分页,拼接 $obj = "select * from wg ".$page->limit; $data = $db->Query($obj); ?> <table> <tr> <td>员工编号</td><td>工资</td><td>时间</td> </tr> <?php foreach ($data as $i){ echo "<tr> <td>{$i[0]}</td><td>{$i[1]}</td><td>{$i[2]}</td> </tr>"; } ?> </table> <div> <?php
//输出显示列表分页 echo $page->fpage(3,4,5,6); ?> </div> </body> </html>

http://www.bkjia.com/PHPjc/1231181.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1231181.htmlTechArticlephp数据库分页,php分页 !DOCTYPE htmlhtml lang="en"head meta charset="UTF-8" titleTitle/title/headbody? php //引入类(分页类10-24博客) require_once "YIN.class.php...