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

  • <legend id='FQzfH'><style id='FQzfH'><dir id='FQzfH'><q id='FQzfH'></q></dir></style></legend>
      <bdo id='FQzfH'></bdo><ul id='FQzfH'></ul>

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

      <tfoot id='FQzfH'></tfoot>
      1. <i id='FQzfH'><tr id='FQzfH'><dt id='FQzfH'><q id='FQzfH'><span id='FQzfH'><b id='FQzfH'><form id='FQzfH'><ins id='FQzfH'></ins><ul id='FQzfH'></ul><sub id='FQzfH'></sub></form><legend id='FQzfH'></legend><bdo id='FQzfH'><pre id='FQzfH'><center id='FQzfH'></center></pre></bdo></b><th id='FQzfH'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='FQzfH'><tfoot id='FQzfH'></tfoot><dl id='FQzfH'><fieldset id='FQzfH'></fieldset></dl></div>
      2. mysqli_real_escape_string() 需要 2 個參數,1 個給定致

        mysqli_real_escape_string() expects exactly 2 parameters, 1 given Fatal Error(mysqli_real_escape_string() 需要 2 個參數,1 個給定致命錯誤)
        <legend id='PEZtQ'><style id='PEZtQ'><dir id='PEZtQ'><q id='PEZtQ'></q></dir></style></legend>
        <i id='PEZtQ'><tr id='PEZtQ'><dt id='PEZtQ'><q id='PEZtQ'><span id='PEZtQ'><b id='PEZtQ'><form id='PEZtQ'><ins id='PEZtQ'></ins><ul id='PEZtQ'></ul><sub id='PEZtQ'></sub></form><legend id='PEZtQ'></legend><bdo id='PEZtQ'><pre id='PEZtQ'><center id='PEZtQ'></center></pre></bdo></b><th id='PEZtQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='PEZtQ'><tfoot id='PEZtQ'></tfoot><dl id='PEZtQ'><fieldset id='PEZtQ'></fieldset></dl></div>
          <tbody id='PEZtQ'></tbody>
              • <small id='PEZtQ'></small><noframes id='PEZtQ'>

                  <bdo id='PEZtQ'></bdo><ul id='PEZtQ'></ul>
                • <tfoot id='PEZtQ'></tfoot>

                  本文介紹了mysqli_real_escape_string() 需要 2 個參數,1 個給定致命錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我不斷收到這個錯誤,我在修復這個錯誤時遇到了問題,我在 PHP 方面并不擅長,因為我還在學習.我正在處理注冊表并使用 PHP 5.6.我查看了有關較舊問題的其他答案,但沒有成功.

                  I keep getting this errors and I am having problems fixing that, am not good in PHP because am still learning. I am working on a registration form and am using PHP 5.6. I have looked at other answers on older questions but I haven't succeeded.

                  這是我的代碼:

                  <?php
                  session_start();
                  if (isset($_SESSION['user']) != "") {
                      header("Location: index.html");
                  }
                  include_once 'dbconnect.php';
                  
                  if (isset($_POST['signup'])) {
                      $fname  = mysqli_real_escape_string($_POST['fullname']);
                      $tphone = mysqli_real_escape_string($_POST['telephone']);
                      $uemail = mysqli_real_escape_string($_POST['email']);
                      $urole  = mysqli_real_escape_string($_POST['role']);
                      $upass  = md5(mysqli_real_escape_string($_POST['upass']));
                      
                      $uname  = trim($uname);
                      $tphone = trim($tphone);
                      $email  = trim($email);
                      $urole  = trim($role);
                      $upass  = trim($upass);
                      
                      // email exist or not
                      $query  = "SELECT email FROM users WHERE email='$uemail'";
                      $result = mysqli_query($query);
                      
                      $count = mysqli_num_rows($result); // if email not found then register
                      
                      if ($count == 0) {
                          
                          if (mysqli_query("INSERT INTO users(firstname,telephone,email,role,pass) VALUES('$fname','$tphone','$uemail','$urole',$upass')")) {
                  ?>
                             <script>alert('successfully registered ');</script>
                              <?php
                          } else {
                  ?>
                             <script>alert('error while registering you...');</script>
                              <?php
                          }
                      } else {
                  ?>
                             <script>alert('Sorry Email ID already taken ...');</script>
                              <?php
                      }
                      
                  }
                  ?> 
                  

                  我不斷收到的錯誤是:

                  警告:mysqli_real_escape_string() 需要 2 個參數,1 個在 C:Apache24htdocsTimewiselandinglogin.php 第 12 行

                  Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in C:Apache24htdocsTimewiselandinglogin.php on line 12

                  警告:mysqli_real_escape_string() 需要 2 個參數,1 個在 C:Apache24htdocsTimewiselandinglogin.php 第 13 行

                  Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in C:Apache24htdocsTimewiselandinglogin.php on line 13

                  警告:mysqli_query() 需要至少 2 個參數,其中 1 個在 C:Apache24htdocsTimewiselandinglogin.php 第 18 行

                  Warning: mysqli_query() expects at least 2 parameters, 1 given in C:Apache24htdocsTimewiselandinglogin.php on line 18

                  警告:mysqli_fetch_array() 期望參數 1 為 mysqli_result,C:Apache24htdocsTimewiselandinglogin.php 第 19 行給出的 null

                  Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in C:Apache24htdocsTimewiselandinglogin.php on line 19

                  警告:mysqli_num_rows() 期望參數 1 為 mysqli_result,C:Apache24htdocsTimewiselandinglogin.php 第 21 行給出的 null

                  Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in C:Apache24htdocsTimewiselandinglogin.php on line 21

                  你能幫我解決這個問題嗎,我需要知道我應該如何實際解決這個問題.

                  Can you please help me on this, I need to know how I should fix this practically.

                  推薦答案

                  技術上回答這個問題,根據手冊,這兩個函數都需要傳遞一個數據庫連接并作為第一個參數:

                  To technically answer this, both of these functions require a db connection be passed and as the first parameter, as per the manuals:

                  • http://php.net/manual/en/mysqli.query.php
                  • http://php.net/manual/en/mysqli.real-escape-string.php

                  然后在評論中聲明您正在使用 PDO 進行連接.

                  Then in comments you state that you are using PDO to connect with.

                  那些不同的 MySQL API 不會混合使用.從連接到查詢,您需要使用相同的方法.因此,如果您想繼續使用 PDO 連接,您將需要使用 PDO 函數來查詢,而不是 mysqli_*.

                  Those different MySQL APIs do not intermix. You need to use the same one from connecting to querying. Therefore, if you want to continue to use a PDO connection, you will need to use the PDO functions to query with and not mysqli_*.

                  • 從手冊開始:http://php.net/manual/en/book.pdo.php 都在里面.
                  • Start with the manual: http://php.net/manual/en/book.pdo.php it's all in there.

                  對于 PDO 準備好的語句:

                  And for PDO prepared statements:

                  • http://php.net/pdo.prepared-statements

                  還要檢查錯誤:

                  • http://php.net/manual/en/pdo.error-handling.php (PDO)
                  • http://php.net/manual/en/function.error-reporting.php (PHP)
                  • http://php.net/manual/en/pdo.error-handling.php (PDO)
                  • http://php.net/manual/en/function.error-reporting.php (PHP)

                  密碼

                  我還注意到您正在嘗試存儲密碼 MD5.不建議這樣做,因為將其用作密碼存儲功能不再被認為是安全的.

                  I also noticed that you are attemtpting to store passwords MD5. This is not recommended as it is no longer considered safe to use as a password storing function.

                  • 如果您打算使用此功能進行直播,不要.

                  使用以下方法之一:

                  • CRYPT_BLOWFISH
                  • crypt()
                  • bcrypt()
                  • scrypt()
                  • 開放式墻
                  • PBKDF2
                  • PHP.net 上的 PBKDF2
                  • PHP 5.5 的 password_hash() 函數.
                  • 兼容包(如果 PHP <5.5)https://github.com/ircmaxell/password_compat/

                  其他鏈接:

                  • PBKDF2 對于 PHP

                  關于列長度的重要旁注:

                  如果您決定使用 password_hash() 或 crypt,請務必注意,如果您當前密碼列的長度小于 60,則需要將其更改為(或更高).手冊建議長度為 255.

                  If and when you do decide to use password_hash() or crypt, it is important to note that if your present password column's length is anything lower than 60, it will need to be changed to that (or higher). The manual suggests a length of 255.

                  您需要更改列的長度并使用新的散列重新開始以使其生效.否則,MySQL 將靜默失敗.

                  You will need to ALTER your column's length and start over with a new hash in order for it to take effect. Otherwise, MySQL will fail silently.

                  我也說過:

                  if (isset($_SESSION['user']) != "") 會給你一個誤報.

                  語法是:if isset AND equals to,而不是if isset equals to,這是它目前被解釋為的內容.

                  The syntax is: if isset AND equals to, and not if isset equals to which is what it is presently being interpreted as.

                  使用:

                  if (isset($_SESSION['user']) && $_SESSION['user'] != "")

                  關于你的 POST 數組.

                  In regards to your POST arrays.

                  確保您使用的 HTML 表單確實使用了 POST 方法,并且所有元素都擁有各自的名稱屬性.

                  Make sure the HTML form you are using does use a POST method and that all elements hold their respective name attributes.

                  即:

                  請注意,name="fullname"name="FullName" 是兩種不同的動物.

                  Note that name="fullname" and name="FullName" are two different animals.

                  • 那些區分大小寫.

                  還建議在每個header后面加上exit;,否則你的代碼可能想繼續執行.

                  It is also suggested to add exit; after each header, otherwise your code may want to continue to execute.

                  header("Location: index.html");
                  exit;
                  

                  這篇關于mysqli_real_escape_string() 需要 2 個參數,1 個給定致命錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='G5CbG'></tfoot>
                    <tbody id='G5CbG'></tbody>

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

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

                          • 主站蜘蛛池模板: 午夜激情在线 | 剑来高清在线观看 | 精品一区二区久久久久久久网站 | 91麻豆精品国产91久久久久久久久 | 四虎影院在线观看av | 欧美激情一区二区三级高清视频 | 91精品国产欧美一区二区成人 | 日韩成人在线播放 | 国产精品久久性 | 黄色香蕉视频在线观看 | 欧美性猛交 | 香蕉91| 亚洲色在线视频 | 久久久久九九九女人毛片 | 成人免费视频网站在线看 | 91欧美精品成人综合在线观看 | 久久精品小短片 | 一区二区三区成人 | 国产在线一区二区 | 91欧美精品成人综合在线观看 | 99这里只有精品视频 | 日韩欧美国产一区二区 | 男人天堂免费在线 | 91伊人 | 伊人网综合 | 亚洲 成人 av | 国产精品亚洲精品 | 欧美一区二区 | 午夜视频在线播放 | 激情欧美一区二区三区 | 精品国产一区二区 | 亚洲国产乱码 | 91久久精品国产91久久 | 九九综合| 久久综合一区 | 日本高清中文字幕 | 精品免费国产一区二区三区四区 | 久久久久国产一区二区三区四区 | 日本黄色免费大片 | 欧美日本一区 | 国产偷录叫床高潮录音 |