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

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

      <bdo id='PwfcU'></bdo><ul id='PwfcU'></ul>

    <tfoot id='PwfcU'></tfoot>

    <legend id='PwfcU'><style id='PwfcU'><dir id='PwfcU'><q id='PwfcU'></q></dir></style></legend>
    1. mysqli fetch_all() 不是一个有效的函数?

      时间:2023-07-31
          <tbody id='hQY7P'></tbody>
      • <i id='hQY7P'><tr id='hQY7P'><dt id='hQY7P'><q id='hQY7P'><span id='hQY7P'><b id='hQY7P'><form id='hQY7P'><ins id='hQY7P'></ins><ul id='hQY7P'></ul><sub id='hQY7P'></sub></form><legend id='hQY7P'></legend><bdo id='hQY7P'><pre id='hQY7P'><center id='hQY7P'></center></pre></bdo></b><th id='hQY7P'></th></span></q></dt></tr></i><div id='hQY7P'><tfoot id='hQY7P'></tfoot><dl id='hQY7P'><fieldset id='hQY7P'></fieldset></dl></div>

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

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

            1. <tfoot id='hQY7P'></tfoot>
                <bdo id='hQY7P'></bdo><ul id='hQY7P'></ul>
                本文介绍了mysqli fetch_all() 不是一个有效的函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                感谢答案,我发现我无法使用 fetch_all() 因为我使用的是 PHP 5.2.17 - fetch_assoc> 使用 while 循环工作.

                Thanks to the answers I have figured out that I am unable to use fetch_all() because i am using PHP 5.2.17 - fetch_assoc with while loop worked.

                我正在使用的函数 fetch_all 返回此错误:

                The function I am using fetch_all is coming back with this error:

                致命错误:调用未定义的方法mysqli_result::fetch_all()

                Fatal error: Call to undefined method mysqli_result::fetch_all() in

                $mysqli = new mysqli($host, $username, $password, $database);
                $query = "LONG QUERY that works, tested in phpmyadmin"
                $result = $mysqli->query($query);
                $result->fetch_all(); or  $mysqli->fetch_all() tried both
                mysqli_fetch_all() was already tried.
                $mysqli->close(); 
                

                我能够连接到数据库并且我已经提取了单行.当我将查询放在 PHPMYADMIN 中时,我得到 5 行.

                I am able to connect to the DB and I have pulled single rows. When I place the query in PHPMYADMIN I get 5 rows back.

                这个功能还能用吗?有没有办法可以自己将数据放入关联数组中?

                Does this function even work? Is there a way I can place my data into an assoc array on my own?

                推荐答案

                该函数自 PHP 5.3.0 起可用.可能你的版本比较旧.改用 fetch_assoc().

                This function is available since PHP 5.3.0. Possibly your version is older. Use fetch_assoc() instead.

                while ($row = $result->fetch_assoc()) {
                    // do what you need.
                }
                

                这篇关于mysqli fetch_all() 不是一个有效的函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何将我的站点从 mysql 迁移到 mysqli? 下一篇:mysqli_fetch_array while 循环列

                相关文章

                最新文章

                  <tfoot id='yltoI'></tfoot>

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

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

                      <bdo id='yltoI'></bdo><ul id='yltoI'></ul>