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

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

      • <bdo id='IHJJv'></bdo><ul id='IHJJv'></ul>
    1. <small id='IHJJv'></small><noframes id='IHJJv'>

      <tfoot id='IHJJv'></tfoot>

        mysqli : 嚴格的標準:只應通過引用傳遞變量

        mysqli : Strict Standards: Only variables should be passed by reference(mysqli : 嚴格的標準:只應通過引用傳遞變量)

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

        1. <tfoot id='BHXQS'></tfoot>

                <bdo id='BHXQS'></bdo><ul id='BHXQS'></ul>
              • <legend id='BHXQS'><style id='BHXQS'><dir id='BHXQS'><q id='BHXQS'></q></dir></style></legend>
              • <i id='BHXQS'><tr id='BHXQS'><dt id='BHXQS'><q id='BHXQS'><span id='BHXQS'><b id='BHXQS'><form id='BHXQS'><ins id='BHXQS'></ins><ul id='BHXQS'></ul><sub id='BHXQS'></sub></form><legend id='BHXQS'></legend><bdo id='BHXQS'><pre id='BHXQS'><center id='BHXQS'></center></pre></bdo></b><th id='BHXQS'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BHXQS'><tfoot id='BHXQS'></tfoot><dl id='BHXQS'><fieldset id='BHXQS'></fieldset></dl></div>
                    <tbody id='BHXQS'></tbody>
                  本文介紹了mysqli : 嚴格的標準:只應通過引用傳遞變量的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試創建一個小型 SQL 查詢類.

                  I'm trying to create a small SQL query class.

                  這是我的班級,但我不知道為什么,我有這個錯誤:嚴格的標準:在第 52 行中只應通過引用傳遞變量

                  Here is my Class but i don't why, I've this error : Strict Standards: Only variables should be passed by reference in line 52

                  第 52 行是:

                  if (!$stmt->bind_param($param[$i][0], mysqli_real_escape_string($this->mysqli, $param[$i][1]))) {
                  

                  我的代碼(我開始了):

                  My code (i'm beginning) :

                  <?php
                  class Sql{
                  
                      private $db;
                      private $user;
                      private $pwd;
                      private $url;
                  
                      private $param;
                  
                      private $mysqli;
                  
                      function __construct($db, $user, $pwd, $url){
                          $this->db = $db;
                          $this->user = $user;
                          $this->pwd = $pwd;
                          $this->url = $url;
                  
                  
                      }
                  
                      /**
                       * mysqli::connection()
                       * 
                       * @return 
                       */
                      public function connection()
                      {
                          try{
                              $this->mysqli = new mysqli($this->db, $this->user, $this->pwd, $this->url);
                          }catch(Exception $e){
                              throw new Exception("Impossible de se connecter à la base " . $this->db);
                          }
                      }
                  
                      public function select($query, $param, $debug=false){
                  
                          $this->connection();
                  
                          $r = $this->InitialiseResult("select");
                  
                          if (!($stmt = $this->mysqli->prepare($query))) {
                              echo "Echec de la préparation : (" . $this->mysqli->errno . ") " . $this->mysqli->error;
                          }
                  
                          //Param
                          for($i=0;$i<sizeof($param);$i++){
                              if (!$stmt->bind_param($param[$i][0], mysqli_real_escape_string($this->mysqli, $param[$i][1]))) {
                                  echo "Echec lors du liage des paramètres : (" . $stmt->errno . ") " . $stmt->error;
                              }
                          }
                  
                          if (!$stmt->execute()) {
                              echo "Echec lors de l'exécution : (" . $stmt->errno . ") " . $stmt->error;
                          }
                  
                          if (!($res = $stmt->get_result())) {
                              echo "Echec lors de la récupération du jeu de résultats : (" . $stmt->errno . ") " . $stmt->error;
                          }else{
                  
                              $r["state"] = true;
                              $r["rows"] = $res->fetch_assoc();
                              $r["num_rows"] = $res->num_rows;
                  
                              if($debug)
                                  var_dump($r);
                  
                          }
                  
                          return $r;
                  
                      }
                  
                  
                      /**
                       * mysqli::InitialiseResult()
                       *
                       * @param mixed $p
                       * @return
                       */
                      public function InitialiseResult($p)
                      {
                          $r = array(); //on écrase
                          $r["state"] = false;
                  
                          switch($p){
                              case "select":
                  
                                  $r["rows"] = array();
                                  $r["num_rows"] = 0;
                                  break;
                  
                          }
                  
                          return $r;
                      }
                  }
                  ?>
                  

                  我嘗試將 $param 放在一個屬性中并使用它是 mysqli_real_escape_string() 但錯誤仍然存??在.

                  I've try to put $param in a property and use that is mysqli_real_escape_string() but the error is still there.

                  有什么想法嗎?

                  推薦答案

                  $stmt->bind_param() 要求所有的params都通過引用傳遞,所以不能傳遞函數的返回值直接(而不是先將其分配給變量).但是,正如評論中已經提到的,您根本不需要轉義參數,這是使用準備好的語句的優勢之一.

                  $stmt->bind_param() requires all params to be passed by reference, so you can't pass function's return value directly (without assigning it to a variable first, that is). But, as was already mentioned in the comments, you don't need to escape the parameters at all, that's one of the advantages of using prepared statements.

                  這篇關于mysqli : 嚴格的標準:只應通過引用傳遞變量的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                    <tfoot id='XpRMC'></tfoot>
                      <tbody id='XpRMC'></tbody>

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

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

                          <i id='XpRMC'><tr id='XpRMC'><dt id='XpRMC'><q id='XpRMC'><span id='XpRMC'><b id='XpRMC'><form id='XpRMC'><ins id='XpRMC'></ins><ul id='XpRMC'></ul><sub id='XpRMC'></sub></form><legend id='XpRMC'></legend><bdo id='XpRMC'><pre id='XpRMC'><center id='XpRMC'></center></pre></bdo></b><th id='XpRMC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='XpRMC'><tfoot id='XpRMC'></tfoot><dl id='XpRMC'><fieldset id='XpRMC'></fieldset></dl></div>
                          <legend id='XpRMC'><style id='XpRMC'><dir id='XpRMC'><q id='XpRMC'></q></dir></style></legend>
                            主站蜘蛛池模板: 日本少妇一区二区 | 久久成人一区 | 欧美一级视频在线观看 | 蜜臀久久99精品久久久久宅男 | 激情丁香| 糖心vlog精品一区二区 | 欧美成人高清 | 国产白丝精品91爽爽久久 | 欧美成人精品欧美一级乱黄 | 成人在线免费看 | 69er小视频| 成人午夜在线视频 | 色福利网 | 午夜精品一区二区三区在线视频 | 欧美视频a | 美女免费视频网站 | 激情五月综合 | 久久成人毛片 | 天天天天天操 | 看国产毛片 | 国产日韩欧美一区二区 | 一级特黄色片 | 国产成人在线免费视频 | 日韩中文字幕视频 | 亚洲国产黄色 | 亚洲第一视频网站 | 日韩精品国产一区 | 黄网站免费观看 | 超碰麻豆| 欧美日韩一二三 | 国产精品手机在线 | 国产极品国产极品 | 成人精品在线 | 吃奶动态图 | av色在线 | 亚洲最大的网站 | 校园春色综合网 | 欧美xxxx性 | 欧美精品系列 | 女人高潮特级毛片 | 日韩手机看片 |