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

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

  • <legend id='rFdUQ'><style id='rFdUQ'><dir id='rFdUQ'><q id='rFdUQ'></q></dir></style></legend>

    <tfoot id='rFdUQ'></tfoot>

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

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

      1. 如何使用 MySQLi 在 PHP 中獲取數據?

        How to fetch data in PHP with MySQLi?(如何使用 MySQLi 在 PHP 中獲取數據?)
          <tbody id='RL3Bo'></tbody>
      2. <small id='RL3Bo'></small><noframes id='RL3Bo'>

              • <legend id='RL3Bo'><style id='RL3Bo'><dir id='RL3Bo'><q id='RL3Bo'></q></dir></style></legend>
                <tfoot id='RL3Bo'></tfoot>
                <i id='RL3Bo'><tr id='RL3Bo'><dt id='RL3Bo'><q id='RL3Bo'><span id='RL3Bo'><b id='RL3Bo'><form id='RL3Bo'><ins id='RL3Bo'></ins><ul id='RL3Bo'></ul><sub id='RL3Bo'></sub></form><legend id='RL3Bo'></legend><bdo id='RL3Bo'><pre id='RL3Bo'><center id='RL3Bo'></center></pre></bdo></b><th id='RL3Bo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='RL3Bo'><tfoot id='RL3Bo'></tfoot><dl id='RL3Bo'><fieldset id='RL3Bo'></fieldset></dl></div>
                • <bdo id='RL3Bo'></bdo><ul id='RL3Bo'></ul>
                  本文介紹了如何使用 MySQLi 在 PHP 中獲取數據?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我嘗試了多次,但無法成功獲得正確的語法——根據 PHP 5.5.12——從我的數據庫中獲取單行或多行.

                  I tried several times but cannot succeed in getting the right syntax—according to PHP 5.5.12 —to fetch single or multiple rows from my database.

                  session_start();
                  $con=mysqli_connect("localhost","root","","doortolearn");
                  if (!$con) {
                      echo "Could not connect to DBMS";       
                  }
                      $query="select * from teacher where tremail='$_POST[email]' and trpasssword='$_POST[password]'";
                      $result=mysqli_query($con,$query);
                      $flag=FALSE;
                      while ($row=mysqli_fetch_array($result,MYSQLI_BOTH)) {
                          $_SESSION['email']=$row['email'];
                          $flag=TRUE;
                      }
                  

                  推薦答案

                  首先,$_POST[password]周圍沒有單引號':

                  First, you have no single quotes ' around $_POST[password]:

                  $query = "SELECT * FROM teacher WHERE tremail='". $_POST['email'] ."' and trpasssword='" . $_POST['password'] . "'";
                  $result = mysqli_query($con, $query) or die(mysqli_error($con));
                  $flag = FALSE;
                  while ($row = mysqli_fetch_array($result, MYSQLI_BOTH)) {
                      $_SESSION['email'] = $row['email'];
                      $flag = TRUE;
                  }
                  

                  但除此之外,您是否甚至在此處設置了 MySQL 數據庫連接?我看到 $con 但這真的有效嗎?

                  But past that, do you even have a MySQL database connection set here? I see $con but is that really working?

                  此外,通過將 或 die(mysql_error($con)) 添加到您的 mysqli_query($con, $query) 行來檢查是否存在錯誤.

                  Also, check if there are errors by adding or die(mysql_error($con)) to your mysqli_query($con, $query) line.

                  此外,您有一個 $_SESSION 值,但您是否在腳本的開頭設置了 session_start?

                  Also, you have a $_SESSION value, but do you even set session_start at the beginning of your script?

                  但我也建議您使用 mysqli_stmt_bind_param 作為您的值,如果您不打算進行基本驗證,至少可以將它們轉義:

                  But I also recommend you use mysqli_stmt_bind_param for your values to at least escape them if you are not going to do basic validation:

                  $query = "SELECT * FROM teacher WHERE tremail=? and trpasssword=?";
                  mysqli_stmt_bind_param($query, 'ss', $_POST['email'], $_POST['password']);
                  $result = mysqli_query($con, $query) or die(mysqli_error($con));
                  $flag = FALSE;
                  while ($row = mysqli_fetch_array($result, MYSQLI_BOTH)) {
                      $_SESSION['email'] = $row['email'];
                      $flag = TRUE;
                  }
                  

                  這篇關于如何使用 MySQLi 在 PHP 中獲取數據?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 中保持其類型?)
                  1. <tfoot id='kAHJ6'></tfoot>
                    <legend id='kAHJ6'><style id='kAHJ6'><dir id='kAHJ6'><q id='kAHJ6'></q></dir></style></legend>

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

                              <tbody id='kAHJ6'></tbody>
                            主站蜘蛛池模板: 91新视频 | 欧美一区二区三区四区在线 | 国产精品视频免费观看 | 国产一区二 | 亚洲精选一区二区 | 中文字幕一区二区三区不卡在线 | 色资源在线观看 | 99久热在线精品视频观看 | 北条麻妃一区二区三区在线观看 | 99久久电影 | 久久久久国产一区二区三区四区 | 在线看片网站 | 精品网站999| 国产精品视频不卡 | 欧美精品日韩精品 | 国产九九精品 | 国产精品亚洲综合 | 天堂亚洲网 | 久久伊人精品一区二区三区 | 成人性生交大片免费看中文带字幕 | a级毛片毛片免费观看久潮喷 | 国产精品黄色 | 精品欧美一区免费观看α√ | 亚洲中午字幕 | 久久久www| 91免费看片 | 国产日韩欧美一区 | www亚洲成人| 99色综合| 精品www | 成人欧美一区二区三区黑人孕妇 | 欧美日韩成人在线 | 国产精品久久精品 | 日本午夜免费福利视频 | 亚洲精品aⅴ | 久久午夜视频 | 亚洲看片网站 | 一级黄色淫片 | 美美女高清毛片视频免费观看 | 一级毛片免费 | 日本不卡高清视频 |