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

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

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

        MYSQLi bind_result 返回 null

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

                • <small id='UO4N3'></small><noframes id='UO4N3'>

                  <legend id='UO4N3'><style id='UO4N3'><dir id='UO4N3'><q id='UO4N3'></q></dir></style></legend>
                  <tfoot id='UO4N3'></tfoot>
                  本文介绍了MYSQLi bind_result 返回 null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我试图在查询中输出从数据库中获取的变量,但没有返回任何内容.使用 MYSQLi 准备好的语句.

                  I am trying to output the variables that I get from the database in my query but nothing is being returned. Using MYSQLi prepared statements.

                  请看下面的代码:

                  $stmt = $con->prepare("SELECT first_name, last_name FROM transactions WHERE order_id = ?");
                  $stmt->bind_param('i', $order_id);
                  $stmt->execute(); 
                  $stmt->store_result();
                  $stmt->bind_result($first_name, $last_name);
                  $stmt->close();
                  
                  
                  // Output review live to page 
                  echo $first_name;
                  

                  我哪里出错了?

                  推荐答案

                  您忘记了获取结果的行.fetch().

                  You forgot the line to fetch the result. fetch().

                  试试:

                    $stmt->bind_result($first_name, $last_name);
                    $stmt->fetch();  // ----- > you forget that line to fetch results.
                    $stmt->close();
                    
                  

                  这篇关于MYSQLi bind_result 返回 null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Mysqli Prepare 语句 + 绑定顺序 BY 下一篇:mysqli_num_rows() 期望参数 1 是 mysqli_result,对象

                  相关文章

                  最新文章

                  <tfoot id='6MBjH'></tfoot>

                  • <bdo id='6MBjH'></bdo><ul id='6MBjH'></ul>

                  <small id='6MBjH'></small><noframes id='6MBjH'>

                    <legend id='6MBjH'><style id='6MBjH'><dir id='6MBjH'><q id='6MBjH'></q></dir></style></legend>

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