pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

      <bdo id='V2Pvg'></bdo><ul id='V2Pvg'></ul>
    <legend id='V2Pvg'><style id='V2Pvg'><dir id='V2Pvg'><q id='V2Pvg'></q></dir></style></legend>
  • <small id='V2Pvg'></small><noframes id='V2Pvg'>

      <tfoot id='V2Pvg'></tfoot>

        <i id='V2Pvg'><tr id='V2Pvg'><dt id='V2Pvg'><q id='V2Pvg'><span id='V2Pvg'><b id='V2Pvg'><form id='V2Pvg'><ins id='V2Pvg'></ins><ul id='V2Pvg'></ul><sub id='V2Pvg'></sub></form><legend id='V2Pvg'></legend><bdo id='V2Pvg'><pre id='V2Pvg'><center id='V2Pvg'></center></pre></bdo></b><th id='V2Pvg'></th></span></q></dt></tr></i><div class="fvrb535" id='V2Pvg'><tfoot id='V2Pvg'></tfoot><dl id='V2Pvg'><fieldset id='V2Pvg'></fieldset></dl></div>

        分頁的最低限度?

        Bare Minimum of a Pagination?(分頁的最低限度?)

          <bdo id='e4Gsg'></bdo><ul id='e4Gsg'></ul>
        • <tfoot id='e4Gsg'></tfoot>
          <i id='e4Gsg'><tr id='e4Gsg'><dt id='e4Gsg'><q id='e4Gsg'><span id='e4Gsg'><b id='e4Gsg'><form id='e4Gsg'><ins id='e4Gsg'></ins><ul id='e4Gsg'></ul><sub id='e4Gsg'></sub></form><legend id='e4Gsg'></legend><bdo id='e4Gsg'><pre id='e4Gsg'><center id='e4Gsg'></center></pre></bdo></b><th id='e4Gsg'></th></span></q></dt></tr></i><div class="hrvnbf7" id='e4Gsg'><tfoot id='e4Gsg'></tfoot><dl id='e4Gsg'><fieldset id='e4Gsg'></fieldset></dl></div>

          <small id='e4Gsg'></small><noframes id='e4Gsg'>

                <tbody id='e4Gsg'></tbody>
              <legend id='e4Gsg'><style id='e4Gsg'><dir id='e4Gsg'><q id='e4Gsg'></q></dir></style></legend>

                • 本文介紹了分頁的最低限度?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  PHP/MySQLi 中最少的分頁是多少?我在網上搜索過并嘗試學習如何進行分頁,但所有示例都很大,所以我想知道是否最少需要多少才能從那里開始,然后努力理解它們.

                  What's the bare minimum of a pagination in PHP/MySQLi? I have searched online and have tried to learn how to do a pagination but all the examples are huge, so I was wondering if what's the minimum so I can start there and then work my way into understanding them.

                  我嘗試過的地方(不是我看過的所有例子);https://github.com/BenGriffiths/pdo-mysqli-pagination ;http://bluedogwebservices.com/php-pagination-with-mysqli/ ;

                  Places I have attempted (examples not all that I looked at); https://github.com/BenGriffiths/pdo-mysqli-pagination ; http://bluedogwebservices.com/php-pagination-with-mysqli/ ;

                  第一個很長(似乎)但對我來說有一定的意義,第二個較短但對我來說意義不大,我還沒有想過要尋找視頻教程,所以我要去搜索對于那些也是.

                  The first one was extremely long (seemingly) but it made sense in parts to me, the second one was shorter but made less sense to me, I haven't though of looking for video tutorials yet so I am going to search for those too.

                  推薦答案

                  分頁比較簡單,我會盡量用最簡單的方式來描述.

                  Pagination is relatively simple and I will attempt to describe it in the simplest way I can.

                  首先,您會在大多數分頁場景中遇到 5 個術語或短語(或參數):

                  To start off with here are 5 terms or phrases (or parameters) that you will come across in most pagination scenarios:

                  • 限制(或每頁結果)
                  • 偏移量(從哪里開始結果/記錄集)
                  • 當前頁面
                  • 總結果
                  • 頁數

                  以下面的示例查詢為例:

                  Take the example query below:

                  SELECT * FROM products WHERE active = 1 LIMIT 0 , 25
                  

                  在上面的 SQL 中(它應該適用于 mysqli):

                  In the SQL above (it should work for mysqli):

                  • 25 => 是限制(或每頁結果)
                  • 0 => 是偏移量(即從結果或記錄 0 開始)

                  翻譯成,

                  give me the results 0 - 24, i.e. the first 25 results
                  

                  因此,假設您有一個包含 1000 條記錄的產品表,并且您需要在網頁上顯示這些記錄,每頁僅顯示 25 條記錄:在您的第一頁上,這些將是上述 5 個術語的值:

                  So, assuming that you had a product table with 1000 records and you needed to display these on a webpage only showing 25 records per page: On your first page these will be the value of the 5 terms above:

                  • 限制(每頁結果)=> 25
                  • 偏移 => 0
                  • 當前頁面 => 1
                  • 總結果 => 1000
                  • 頁數 => 總結果/限制 => 40

                  通常偏移量是根據當前頁面和限制動態計算的,因此對于您的產品結果的第 1 頁,偏移量將等于:

                  Usually the offset is calculated dynamically based on the current page and the limit, so for page 1 of your product results, the offset would be equal to:

                  offset = (current page * limit) - limit
                  i.e. (1 * 25) - 25 = 0
                  

                  所以你的 mysqli 查詢將是:

                  so your mysqli query would be:

                  SELECT * FROM products WHERE active = 1 LIMIT [OFFSET] , [LIMIT]
                  
                  i.e. SELECT * FROM products WHERE active = 1 LIMIT 0 , 25
                  

                  對產品結果的第 2 頁使用相同的原則,偏移量(或起始結果)為:

                  Using the same principle for page 2 of your product results, the offset (or start results from) would be:

                  offset = (current page * limit) - limit
                  i.e. (2 * 25) - 25 = 25
                  

                  所以你的 mysqli 查詢將是:

                  so your mysqli query would be:

                  SELECT * FROM products WHERE active = 1 LIMIT [OFFSET] , [LIMIT]
                  
                  i.e. SELECT * FROM products WHERE active = 1 LIMIT 25 , 25
                  

                  翻譯成,

                  give me the results 25 - 49, i.e. the next 25 results starting from record 25
                  

                  其他術語將具有以下值:

                  the other terms would have the following values:

                  • 限制(或每頁結果)=> 25
                  • 當前頁面 => 2
                  • 總結果 => 1000
                  • 頁數 => 40

                  在大多數簡單的分頁用例中,唯一改變的參數是偏移量和當前頁面.如果您在查詢中引入過濾器,那么除了前 2 個過濾器之外,總結果和頁數也會發生變化.

                  In most simple use-cases for pagination, the only parameters that change are the offset and the current page. If you introduce filters into your queries then in addition to the former 2, the total results and the number of pages can change as well.

                  我希望以上的解??釋有助于讓您對分頁有一個基本的了解.

                  I hope the above explanation has helped to provide you with a basic understanding of pagination.

                  這篇關于分頁的最低限度?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  store_result() and get_result() in mysql returns false(mysql 中的 store_result() 和 get_result() 返回 false)
                  Call to undefined function mysqli_result::num_rows()(調用未定義的函數 mysqli_result::num_rows())
                  PHP Prepared Statement Problems(PHP 準備好的語句問題)
                  mysqli_fetch_array returning only one result(mysqli_fetch_array 只返回一個結果)
                  PHP MySQLi Multiple Inserts(PHP MySQLi 多次插入)
                  How do I make sure that values from MySQL keep their type in PHP?(如何確保 MySQL 中的值在 PHP 中保持其類型?)
                    • <bdo id='RKDUP'></bdo><ul id='RKDUP'></ul>

                      <small id='RKDUP'></small><noframes id='RKDUP'>

                      • <i id='RKDUP'><tr id='RKDUP'><dt id='RKDUP'><q id='RKDUP'><span id='RKDUP'><b id='RKDUP'><form id='RKDUP'><ins id='RKDUP'></ins><ul id='RKDUP'></ul><sub id='RKDUP'></sub></form><legend id='RKDUP'></legend><bdo id='RKDUP'><pre id='RKDUP'><center id='RKDUP'></center></pre></bdo></b><th id='RKDUP'></th></span></q></dt></tr></i><div class="rrjlvb5" id='RKDUP'><tfoot id='RKDUP'></tfoot><dl id='RKDUP'><fieldset id='RKDUP'></fieldset></dl></div>

                          <tfoot id='RKDUP'></tfoot>

                          <legend id='RKDUP'><style id='RKDUP'><dir id='RKDUP'><q id='RKDUP'></q></dir></style></legend>
                            <tbody id='RKDUP'></tbody>

                          1. 主站蜘蛛池模板: 禹城彩钢厂_钢结构板房_彩钢复合板-禹城泰瑞彩钢复合板加工厂 | 披萨石_披萨盘_电器家电隔热绵加工定制_佛山市南海区西樵南方综合保温材料厂 | 3d打印服务,3d打印汽车,三维扫描,硅胶复模,手板,快速模具,深圳市精速三维打印科技有限公司 | 气胀轴|气涨轴|安全夹头|安全卡盘|伺服纠偏系统厂家-天机传动 | 硫化罐-电加热蒸汽硫化罐生产厂家-山东鑫泰鑫智能装备有限公司 | 武汉EPS线条_EPS装饰线条_EPS构件_湖北博欧EPS线条厂家 | 校园文化空间设计-数字化|中医文化空间设计-党建|法治廉政主题文化空间施工-山东锐尚文化传播公司 | 深圳市八百通智能技术有限公司官方网站 | 培训中心-翰香原香酥板栗饼加盟店总部-正宗板栗酥饼技术 | 外贮压-柜式-悬挂式-七氟丙烷-灭火器-灭火系统-药剂-价格-厂家-IG541-混合气体-贮压-非贮压-超细干粉-自动-灭火装置-气体灭火设备-探火管灭火厂家-东莞汇建消防科技有限公司 | 甲级防雷检测仪-乙级防雷检测仪厂家-上海胜绪电气有限公司 | 非甲烷总烃分析仪|环控百科 | 中天寰创-内蒙古钢结构厂家|门式刚架|钢结构桁架|钢结构框架|包头钢结构煤棚 | 正压送风机-多叶送风口-板式排烟口-德州志诺通风设备 | 12cr1mov无缝钢管切割-15crmog无缝钢管切割-40cr无缝钢管切割-42crmo无缝钢管切割-Q345B无缝钢管切割-45#无缝钢管切割 - 聊城宽达钢管有限公司 | 钢衬玻璃厂家,钢衬玻璃管道 -山东东兴扬防腐设备有限公司 | ptc_浴霸_大巴_干衣机_呼吸机_毛巾架_电动车加热器-上海帕克 | 耐高温风管_耐高温软管_食品级软管_吸尘管_钢丝软管_卫生级软管_塑料波纹管-东莞市鑫翔宇软管有限公司 | 防锈油-助焊剂-光学玻璃清洗剂-贝塔防锈油生产厂家 | 欧版反击式破碎机-欧版反击破-矿山石料破碎生产线-青州奥凯诺机械 | 上海律师咨询_上海法律在线咨询免费_找对口律师上策法网-策法网 广东高华家具-公寓床|学生宿舍双层铁床厂家【质保十年】 | 无负压供水设备,消防稳压供水设备-淄博创辉供水设备有限公司 | 臭氧发生器_臭氧消毒机 - 【同林品牌 实力厂家】 | 九州网址_专注于提供网址大全分享推广中文网站导航服务 | 陕西视频监控,智能安防监控,安防系统-西安鑫安5A安防工程公司 | 铸钢件厂家-铸钢齿轮-减速机厂家-淄博凯振机械有限公司 | 深圳APP开发_手机软件APP定制外包_小程序开发公司-来科信 | 小威小说网 - 新小威小说网 - 小威小说网小说搜索引擎 | 阿尔法-MDR2000无转子硫化仪-STM566 SATRA拉力试验机-青岛阿尔法仪器有限公司 | 整车VOC采样环境舱-甲醛VOC预处理舱-多舱法VOC检测环境仓-上海科绿特科技仪器有限公司 | 安徽成考网-安徽成人高考网 | 派克防爆伺服电机品牌|国产防爆伺服电机|高低温伺服电机|杭州摩森机电科技有限公司 | 桁架楼承板-钢筋桁架楼承板-江苏众力达钢筋楼承板厂 | 阻垢剂-反渗透缓蚀阻垢剂厂家-山东鲁东环保科技有限公司 | Safety light curtain|Belt Sway Switches|Pull Rope Switch|ultrasonic flaw detector-Shandong Zhuoxin Machinery Co., Ltd | Eiafans.com_环评爱好者 环评网|环评论坛|环评报告公示网|竣工环保验收公示网|环保验收报告公示网|环保自主验收公示|环评公示网|环保公示网|注册环评工程师|环境影响评价|环评师|规划环评|环评报告|环评考试网|环评论坛 - Powered by Discuz! | 智能终端_RTU_dcm_北斗星空自动化科技 | 喷播机厂家_二手喷播机租赁_水泥浆洒布机-河南青山绿水机电设备有限公司 | 深圳侦探联系方式_深圳小三调查取证公司_深圳小三分离机构 | 环压强度试验机-拉链拉力试验机-上海倾技仪器仪表科技有限公司 | 小青瓦丨古建筑瓦丨青瓦厂家-宜兴市徽派古典建筑材料有限公司 |