久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

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

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

        不能在 mysqli_stmt 對象上使用 call_user_func_array

        Cannot use call_user_func_array on mysqli_stmt object(不能在 mysqli_stmt 對象上使用 call_user_func_array)
          • <bdo id='qtEKj'></bdo><ul id='qtEKj'></ul>
            <i id='qtEKj'><tr id='qtEKj'><dt id='qtEKj'><q id='qtEKj'><span id='qtEKj'><b id='qtEKj'><form id='qtEKj'><ins id='qtEKj'></ins><ul id='qtEKj'></ul><sub id='qtEKj'></sub></form><legend id='qtEKj'></legend><bdo id='qtEKj'><pre id='qtEKj'><center id='qtEKj'></center></pre></bdo></b><th id='qtEKj'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='qtEKj'><tfoot id='qtEKj'></tfoot><dl id='qtEKj'><fieldset id='qtEKj'></fieldset></dl></div>

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

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

                    <tbody id='qtEKj'></tbody>

                  <tfoot id='qtEKj'></tfoot>
                1. 本文介紹了不能在 mysqli_stmt 對象上使用 call_user_func_array的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在為 MySQLi 編寫一個包裝類.在那里,我正在編寫一個函數來接受查詢和可變數量的參數,我可以在其中調用 mysqli_stmt::bind_param.代碼如下:

                  I am writing a wrapper class for MySQLi. In there, I am writing a function to accept a query and variable number of parameters where I can invoke mysqli_stmt::bind_param. Here is the code:

                  <?php
                      class DbHelper {
                          ....
                          public function Execute($query, $params){
                              $this->open(); # Opens a connection to the database using MySQLi API
                              $stmt = $this->mysqli->prepare($query);
                              try{
                                  $result = call_user_func_array(array($stmt, 'bind_param'), $params);
                              }
                              catch(Exception $ex){
                                  # Handle Exception
                              }
                          }
                          ....
                      }
                  ?>
                  

                  這是我調用函數的方式:

                  Here's how I am calling the function:

                  <?php
                      $db = new DbHelper();
                      $params = array('i', $stateID);
                      $result = $db->Execute('SELECT * FROM mst_cities WHERE State_ID = ?', $params);    
                  ?>
                  

                  當我運行代碼時,我收到如下警告:
                  警告:mysqli_stmt::bind_param() 的參數 2 應為引用,值在......中給出.

                  When I run the code, I get an warning as this:
                  Warning: Parameter 2 to mysqli_stmt::bind_param() expected to be a reference, value given in......

                  我該怎么辦?

                  推薦答案

                  來自 文檔:

                  注意:

                  將 mysqli_stmt_bind_param() 與 call_user_func_array() 結合使用時必須小心.請注意,mysqli_stmt_bind_param() 需要通過引用傳遞參數,而 call_user_func_array() 可以接受可以表示引用或值的變量列表作為參數.

                  Care must be taken when using mysqli_stmt_bind_param() in conjunction with call_user_func_array(). Note that mysqli_stmt_bind_param() requires parameters to be passed by reference, whereas call_user_func_array() can accept as a parameter a list of variables that can represent references or values.

                  評論中有一些解決方法,例如 看到這個:

                  There are some workarounds in the comments, for example see this:

                  call_user_func_array(array($stmt, 'bind_param'), refValues($params));
                  
                  function refValues($arr)
                  {
                      if (strnatcmp(phpversion(),'5.3') >= 0) //Reference is required for PHP 5.3+
                      {
                          $refs = array();
                          foreach($arr as $key => $value)
                              $refs[$key] = &$arr[$key];
                          return $refs;
                      }
                      return $arr;
                  }
                  

                  這篇關于不能在 mysqli_stmt 對象上使用 call_user_func_array的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  store_result() and get_result() in mysql returns false(mysql 中的 store_result() 和 get_result() 返回 false)
                  Call to undefined function mysqli_result::num_rows()(調用未定義的函數 mysqli_result::num_rows())
                  PHP Prepared Statement Problems(PHP 準備好的語句問題)
                  mysqli_fetch_array returning only one result(mysqli_fetch_array 只返回一個結果)
                  PHP MySQLi Multiple Inserts(PHP MySQLi 多次插入)
                  How do I make sure that values from MySQL keep their type in PHP?(如何確保 MySQL 中的值在 PHP 中保持其類型?)
                    <bdo id='RGJ7y'></bdo><ul id='RGJ7y'></ul>

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

                      <tbody id='RGJ7y'></tbody>

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

                          1. <tfoot id='RGJ7y'></tfoot>
                          2. 主站蜘蛛池模板: 91视频在线看 | 日韩看片| 国产精品久久国产精品 | 国产精品久久久久久吹潮日韩动画 | 亚洲成色777777在线观看影院 | 午夜精品视频在线观看 | 亚洲精品一区中文字幕乱码 | 亚洲一二三区在线观看 | 免费成人高清在线视频 | 中文字幕91 | 精品亚洲一区二区 | 久久精品女人天堂av | 91精品国模一区二区三区 | 国产电影一区二区在线观看 | 久久久久国 | 密桃av | 羞羞色影院 | 亚洲国产一区二区视频 | 亚欧洲精品在线视频免费观看 | 久久精品二区亚洲w码 | 羞羞视频免费在线 | 亚洲高清视频一区 | 91精品国产综合久久香蕉麻豆 | 欧美激情亚洲 | 免费三级av| 久久久久久久久国产成人免费 | 国产精品美女久久久久aⅴ国产馆 | 天天综合久久 | 亚洲视频二区 | 在线免费国产 | 亚洲精品一区二区在线观看 | 日韩国产一区二区三区 | 日韩欧美国产精品一区二区 | 成人久久视频 | 久久久久久久久久久91 | 国产精品久久国产精品 | 国产一区中文 | 日韩精品视频中文字幕 | 国产真实精品久久二三区 | 国产精品日本一区二区不卡视频 | 成人小视频在线观看 |