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

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

      1. <tfoot id='nVomx'></tfoot>

        FOUND_ROWS() 不断返回 0

        FOUND_ROWS() keeps returning 0(FOUND_ROWS() 不断返回 0)

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

              1. <tfoot id='J833e'></tfoot>
                  <tbody id='J833e'></tbody>
              2. <legend id='J833e'><style id='J833e'><dir id='J833e'><q id='J833e'></q></dir></style></legend>
                  <bdo id='J833e'></bdo><ul id='J833e'></ul>
                  <i id='J833e'><tr id='J833e'><dt id='J833e'><q id='J833e'><span id='J833e'><b id='J833e'><form id='J833e'><ins id='J833e'></ins><ul id='J833e'></ul><sub id='J833e'></sub></form><legend id='J833e'></legend><bdo id='J833e'><pre id='J833e'><center id='J833e'></center></pre></bdo></b><th id='J833e'></th></span></q></dt></tr></i><div id='J833e'><tfoot id='J833e'></tfoot><dl id='J833e'><fieldset id='J833e'></fieldset></dl></div>
                  本文介绍了FOUND_ROWS() 不断返回 0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  $result = $db_con->query("SELECT SQL_CALC_FOUND_ROWS * FROM users LIMIT 0,10");
                  
                  $count_result = $db_con->query("SELECT FOUND_ROWS() as totalcount");
                  $row = $count_result->fetch_assoc();
                  $total = $row['totalcount'];
                  

                  即使 $result 包含其中的所有用户行,$total 仍然返回 0.

                  $total keeps returning 0 even though the $result contains all the user rows in it.

                  ini_set("mysql.trace_mode", "0");
                  

                  我通过在此处搜索类似的 Q 发现了此设置,但它没有解决我的问题.

                  I found out about this setting via searching a similar Q on here, but it did not resolve my issue.

                  当我在 MySQL 客户端中使用 2 个 select 语句时,它总是输出正确的计数.只是似乎无法弄清楚如何让它在我的 php 页面上工作.

                  When I use the 2 select statements in my MySQL client it always outputs the right count. Just can't seem to figure out how to get it working on my php page.

                  PHP 版本:5.2.5 构建 6MySQL 版本:5.1.30

                  PHP Version: 5.2.5 build 6 MySQL Version: 5.1.30

                  注意:我在此处提供的代码并未在我的实际项目中使用,但是,它确实体现了我无法检索总数的问题.这段代码,从我读过的关于 found_rows() 的内容来看,应该可以工作,但没有.

                  Note: The code I provided here is not being used on my actual project, however, it does exemplify the problem I am having with not being able to retrieve the total count. This code, from what I've read about found_rows(), should work but it doesn't.

                  推荐答案

                  在 php.net 上,我发现有人可能遇到了同样的问题.他说的是可能发生的竞争条件:php.net.基本上他通过以减慢速度为代价临时锁定表来解决这个问题.

                  On php.net I found someone with maybe the same problem. He is speaking of a race condition that could occur: php.net. Basically he solves this problem by temporary locking the table at the cost of slowing things down.

                  这篇关于FOUND_ROWS() 不断返回 0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                • <tfoot id='qKwJx'></tfoot>

                      <tbody id='qKwJx'></tbody>

                    1. <legend id='qKwJx'><style id='qKwJx'><dir id='qKwJx'><q id='qKwJx'></q></dir></style></legend>
                          <bdo id='qKwJx'></bdo><ul id='qKwJx'></ul>
                        • <small id='qKwJx'></small><noframes id='qKwJx'>

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