久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <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="qwawimqqmiuu" 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="qwawimqqmiuu" 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="qwawimqqmiuu" 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. 主站蜘蛛池模板: 一区福利视频 | 久久成人国产 | 亚洲中午字幕 | 中文字幕人成乱码在线观看 | 亚洲日本免费 | 亚洲热在线视频 | 日本黄色大片免费看 | 久久国产精品一区二区 | 视频一区二区在线观看 | 中文二区 | 日韩一区二区三区四区五区六区 | xxxxxx国产 | 超碰人人艹 | 亚洲综合色丁香婷婷六月图片 | 午夜视频网 | 亚洲日本视频 | 久久久精品天堂 | 久久国产精品一区 | 国产在线视频在线观看 | 国产精品久久久久久妇女6080 | 不卡在线视频 | 中文av在线播放 | 91国内精精品久久久久久婷婷 | 99精品国产一区二区青青牛奶 | 狠狠草视频 | 久久草在线视频 | 一区网站 | 国产成人亚洲精品 | 国产精品久久久久久久久久妇女 | 碰碰视频 | 欧美a免费| 黄色网址大全在线观看 | 成人一区在线观看 | 久久精品中文 | 狠狠干狠狠操 | 国产欧美一区二区久久性色99 | 黄网站免费在线观看 | 亚洲高清视频在线观看 | 神马影院一区二区三区 | www.日韩 | 天天拍天天草 |