久久久久久久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的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在為 MySQLi 編寫一個(gè)包裝類.在那里,我正在編寫一個(gè)函數(shù)來接受查詢和可變數(shù)量的參數(shù),我可以在其中調(diào)用 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
                              }
                          }
                          ....
                      }
                  ?>
                  

                  這是我調(diào)用函數(shù)的方式:

                  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);    
                  ?>
                  

                  當(dāng)我運(yùn)行代碼時(shí),我收到如下警告:
                  警告:mysqli_stmt::bind_param() 的參數(shù) 2 應(yīng)為引用,值在......中給出.

                  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() 結(jié)合使用時(shí)必須小心.請注意,mysqli_stmt_bind_param() 需要通過引用傳遞參數(shù),而 call_user_func_array() 可以接受可以表示引用或值的變量列表作為參數(shù).

                  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.

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

                  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;
                  }
                  

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

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

                  相關(guān)文檔推薦

                  store_result() and get_result() in mysql returns false(mysql 中的 store_result() 和 get_result() 返回 false)
                  Call to undefined function mysqli_result::num_rows()(調(diào)用未定義的函數(shù) mysqli_result::num_rows())
                  PHP Prepared Statement Problems(PHP 準(zhǔn)備好的語句問題)
                  mysqli_fetch_array returning only one result(mysqli_fetch_array 只返回一個(gè)結(jié)果)
                  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. 主站蜘蛛池模板: 久久久免费 | 中文字幕一区二区三区四区 | 国产精品99久 | 男女午夜免费视频 | 99九九久久 | 欧美日韩大片 | 久久伊人免费视频 | 国产欧美精品一区二区色综合 | 成人在线视频一区 | 美女久久久久久久久 | 伊人一区 | 特级特黄特色的免费大片 | 国产精品不卡 | 91免费在线| 视频1区2区 | 亚洲男人的天堂网站 | 91精品午夜窝窝看片 | 国产91在线 | 亚洲 | 天天天天天天操 | 一区二区不卡高清 | 国产女人与拘做受免费视频 | 天天拍夜夜爽 | 日日干日日操 | 射欧美| 91直接看| 久久高清国产视频 | 欧美三级在线 | 五月婷婷亚洲 | 欧美日韩精品综合 | 精品久久久久久久久久久 | 欧美一卡二卡在线观看 | 欧美日韩亚洲国产综合 | 精品综合在线 | 欧美精品在线播放 | 国产a级毛片 | 中文一区 | 日本中出视频 | 情侣av | 免费特级黄毛片 | 中文字幕在线免费视频 | 国产精品18hdxxxⅹ在线 |