• <bdo id='Nzz9f'></bdo><ul id='Nzz9f'></ul>

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

    1. <small id='Nzz9f'></small><noframes id='Nzz9f'>

      1. <legend id='Nzz9f'><style id='Nzz9f'><dir id='Nzz9f'><q id='Nzz9f'></q></dir></style></legend>
        <tfoot id='Nzz9f'></tfoot>

        PDO 限制和偏移

        时间:2023-09-19

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

          • <tfoot id='FB8BZ'></tfoot>
          • <legend id='FB8BZ'><style id='FB8BZ'><dir id='FB8BZ'><q id='FB8BZ'></q></dir></style></legend>

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

                  本文介绍了PDO 限制和偏移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  可能的重复:
                  PHP PDO bindValue 限制

                  在prepare语句中使用LIMIT和/或OFFSET时无法显示数据,但是如果我不使用LIMIT和OFFSET,我可以显示雷磊",代码看起来有问题吗?

                  I could not display the data when using LIMIT and/or OFFSET in the prepare statement, but I can show "Lei Lei" if I don't use the LIMIT and OFFSET, does the code look wrong?

                  $statement = $conn->prepare("SELECT id,username FROM public2 WHERE username = :name LIMIT :sta OFFSET :ppage");
                  $name = "Lei Lei";
                  $statement->execute(array(':name' => $name,':sta' => $start,':ppage' => $per_page));
                  

                  这与原来有效的代码有所不同:

                  This have been change from the original code which worked:

                  $query_pag_data = "SELECT id,username from public2 LIMIT $start, $per_page";
                  $result_pag_data = mysql_query($query_pag_data) or die('MySql Error' . mysql_error());
                  

                  推荐答案

                  我找到了答案!

                  $statement->bindValue(':sta1', (int) $start, PDO::PARAM_INT); 
                  

                  确实有效

                  这篇关于PDO 限制和偏移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在 PDO 准备好的语句中可以参数化哪些令牌? 下一篇:如何使用 PDO 动态构建查询

                  相关文章

                  最新文章

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

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

                    <legend id='nipyM'><style id='nipyM'><dir id='nipyM'><q id='nipyM'></q></dir></style></legend>
                    <tfoot id='nipyM'></tfoot>
                    • <bdo id='nipyM'></bdo><ul id='nipyM'></ul>