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

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

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

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

      3. MySQL SUM 查询问题 php

        时间:2023-12-01
        • <legend id='xblPJ'><style id='xblPJ'><dir id='xblPJ'><q id='xblPJ'></q></dir></style></legend>

              <tbody id='xblPJ'></tbody>

              <bdo id='xblPJ'></bdo><ul id='xblPJ'></ul>
            • <tfoot id='xblPJ'></tfoot>

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

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

                2. 本文介绍了MySQL SUM 查询问题 php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 PHP 中运行以下查询:

                  I have the following query running in PHP:

                  $ticketTotal = mysql_query("SELECT SUM(`tickets_issued`) FROM `tb_att_registered_attendants` WHERE `confirmation_code`!='000000'");
                  

                  但是当我返回 $ticketTotal 时,我得到 Resource id #33 并且当我转储变量时,我得到 resource(33) 类型(mysql结果).当我在 phpMyAdmin 中运行完全相同的查询时,我得到了正确的结果.我似乎在谷歌上找不到太多东西.怎么回事?

                  But when I return $ticketTotal, I get Resource id #33 and when I dump the variable, I get resource(33) of type (mysql result). When I run the exact same query in phpMyAdmin, I get the correct result. I can't seem to find much on google. What is going on?

                  提前感谢您的帮助.

                  推荐答案

                  $ticketTotal 不保存您的查询结果.您仍然必须实际获取它们.

                  $ticketTotal doesn't hold your query results. You still have to actually fetch them.

                  while ($row = mysql_fetch_assoc($ticketTotal))
                  {
                      print_r($row);
                  }
                  

                  请不要在新代码中使用 mysql_* 函数.它们不再被维护并被正式弃用.看到 红框?改为了解 准备好的陈述,并使用 PDO 或 MySQLi- 这篇文章将帮助你决定哪一个.如果您选择 PDO,这里有一个很好的教程.

                  Please, don't use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.

                  这篇关于MySQL SUM 查询问题 php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:合并2个多维数组并求和 下一篇:用数字对替换字符串中的数字求和

                  相关文章

                  <legend id='mmNbb'><style id='mmNbb'><dir id='mmNbb'><q id='mmNbb'></q></dir></style></legend>

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

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

                      <tfoot id='mmNbb'></tfoot>
                        <bdo id='mmNbb'></bdo><ul id='mmNbb'></ul>