zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    1001.A+B Format(20)
    大一下学期的自我目标
    re模块3
    re模块2
    re模块
    configParser模块
    logging模块
    hashlib模块
    sys模块
    isinstance函数
  • 原文地址:https://www.cnblogs.com/dej-11/p/7742870.html
Copyright © 2011-2022 走看看