您所在的位置:小祥子 » 编程 » PHP » 正文

简单的利用php谢了一个分页的功能模块

时间:2015-06-11 编辑:时光隧道冰 来源:本站整理

先贴张图看看效果

JS70rDnXhvjN4w5WP7o7fOm/m1NEiUnHqyH/4LHpPzxu3ZU8UBbP2mcc2xf4cff1VF2Y5K5805W7fNWMHi4jI/mio+I+XP81XHcZ8fUSGeyNvvBxvkzjZccn41Id7XmxesC329+hZ30t7/PBJvB2t7lD0rpDbqr8/7P7Ydn77od+AQHkjT2DA6Pl4+5a1y++Y9c2TT77o4TcPT8v8/t1bIqsWuS85/Stjrv9NWo6J2/zI92f442nCPO7uu2YOExGRUbMfvHtc7Cze84b7gsbgzoLXOMF4Uj7nRudZ+gN/P+T4pA3NJ/3zz/+44fnrqswiIubhV/zntecem69afOlLg9Lv3NyxPHZyzhwnXn72qXjcSKo5gBKmASUl7LHl8sY1n79wk75PwJF4wOYJZyk5+1bGR3ox9LqVB9KL3RG4anjiyt887r6k4x8IecYZH/WEMhSR1YGAQ9/ZfOmTe/qwq7Zp4fnxfSscgaRdE8/3/IVbjXVdWHvWVYEd6WXt8U+N7zFjWS5PIHEERyDj3ZlFN97z5KW9dnBkf4kzVyGlEr1KvP1S99EfMR5eP0jmI2T6N+T4ZsvxWQKlg/YJlDL9O/XAno2vPjzDcN7uWf2Te18sSP+B/s2/b9ebz908YXDikd0P3varzckb73/zrikzHt0er4j5/PuX3GgxbmCudj2ht1H0tZGi57dtS+NFV8yae2n6MIPs1jXfszq27+jrb6jLsuuejz8x1nX2ijd+VTcsfbO3Xv9d7K9x/2RNPtevvfWUWEP/FW366xHp7oqXedSX+lDpaM3v//dnizN6FYAC8gQGBHPF6LP/5amX7z8/cTLb+9RzrxT0mIOHnjHlnlXLrxuauOuVthe3JW7t/P2t35lw6xv6uW+oY8mTs0ellWO5ccUSh17Ibr99rLMta9eJ0d5nf63HiV7GP2Syc/EdP4sPnbBdfXlKj8HIMfHM89lnn+/fvXXr1rdWLVu27Jfzr7766rqzTz311BO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CJPAAAAVeQJAACgijwBAABUkScAAIAq8gQAAFBFngAAAKrIEwAAQBV5AgAAqCJPAAAAVeQJAACgijwBAABUkScAAICq/wcwtnIPMOo2kgAAAABJRU5ErkJggg==" border="0" onload="return imgzoom(this,600);"/>

在贴一下代码吧

<?php
    
    $localhost = "localhost";
    $username = "root";
    $password = "root";
    $db = "test";         //信息
    
    $pagesize = 5;
                              
    $conn = ($localhost,$username,$password); //链接数据库
    
        if(!$conn){
            echo "数据库链接失败".();
        }
    
    ("SET NAMES 'UTF8'");    //编码转化

    $db_select = ($db);  //选择表

                                        //查询记录总数
    $total_sql = "select COUNT(*) from page";
    $total_result = ($total_sql);
    $total_row_arr = ($total_result);
    $total_row = $total_row_arr[0];         //总条数

    //总页数
    $total = ($total_row / $pagesize);
    
    //当前页数
    $page = @$_GET['p'] ? $_GET['p'] : 1;
    
     //limit 下限
    $offset = ($page - 1)*$pagesize;
    
    
    $sql = "select * from page order by id limit {$offset},{$pagesize}";
    
    $result = ($sql);
    
    echo "<p>PHP分页代码的小模块</p>";
    echo "<table border=1 cellspacing=0 WIDTH=60% align=center>";
    echo "<tr><td>ID</td><td>NAME</td></tr>";
    
    while($row = ($result)){
        $id = $row['id'];
        $name = $row['name'];
        echo "<tr><td>".$id."</td><td>".$name."</td></tr>";
    }
    
    echo "</table>";
    //上一页 、下一页
    
    $pageprev = $page -1 ;
        if($page > $total){
            $pagenext = $total;
        } else{
            $pagenext = $page +1;
        }
    
    // 做链接 跳转;
    
    echo "<h3> <a href='page.php?p={$pageprev}'>上一页</a> 丨<a href='page.php?p={$pagenext}'>下一页</a></h3>";
    
    
    
    ($result);
    ($conn);
?>

关键点: 1、$sql = "select * from page order by id limit {$offset},{$pagesize}";

     2、echo "<h3> <a href='page.php?p={$pageprev}'>上一页</a> 丨<a href='page.php?p={$pagenext}'>下一页</a></h3>";

这两点是关键能体现 分页技术 和php 代码艺术的地方~

和大家一起学习吧~

关键词:分页 功能