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

  • <small id='8P7M5'></small><noframes id='8P7M5'>

      <bdo id='8P7M5'></bdo><ul id='8P7M5'></ul>
    <legend id='8P7M5'><style id='8P7M5'><dir id='8P7M5'><q id='8P7M5'></q></dir></style></legend>

      <tfoot id='8P7M5'></tfoot>
      <i id='8P7M5'><tr id='8P7M5'><dt id='8P7M5'><q id='8P7M5'><span id='8P7M5'><b id='8P7M5'><form id='8P7M5'><ins id='8P7M5'></ins><ul id='8P7M5'></ul><sub id='8P7M5'></sub></form><legend id='8P7M5'></legend><bdo id='8P7M5'><pre id='8P7M5'><center id='8P7M5'></center></pre></bdo></b><th id='8P7M5'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='8P7M5'><tfoot id='8P7M5'></tfoot><dl id='8P7M5'><fieldset id='8P7M5'></fieldset></dl></div>
      1. 使用 PHP SESSION 變量存儲 MySQL 查詢結果

        Using PHP SESSION Variables to store MySQL query results(使用 PHP SESSION 變量存儲 MySQL 查詢結果)
          <tbody id='8xtFY'></tbody>
      2. <tfoot id='8xtFY'></tfoot>

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

            1. <small id='8xtFY'></small><noframes id='8xtFY'>

                • 本文介紹了使用 PHP SESSION 變量存儲 MySQL 查詢結果的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想在一個文件中執行查詢,將其存儲在會話變量中,然后在另一個文件中訪問結果.

                  I want to execute a query in one file, store it in a session variable, and access the result in another file.

                  File1.php:

                  //This is the file I have executed my sql statement in
                  //I have already done session_start(); and initialized $conn
                  $query = //my query. I know it is working because I have tested it elsewhere, so I 
                           // don't believe it is the problem
                  $_SESSION['query2'] = mysqli_query($conn, $query)
                  

                  File2.php:

                  //This is the file I want to access my query results in.
                  //I have already done session_start(); and initialized $conn
                  
                  $tempArray =  $_SESSION['query2'];
                  
                  if (isset($tempArray)) {
                      $row = mysqli_fetch_array($tempArray, MYSQL_NUM);
                      if ($row == null) {
                          echo "<h1> error </h1>"; //This line gets executed
                      } else {
                          echo "<h1> works! </h1>";
                      }
                  } else {
                      echo "<h1> array not set </h1>";
                  }
                  

                  對我做錯了什么有任何想法嗎?或者,有沒有其他方法可以完成我在這里嘗試做的事情?

                  Any ideas as to what I am doing wrong? Or, is there another way to accomplish what I'm trying to do here?

                  推薦答案

                  在會話中存儲實際數組:

                  Store the actual array in session:

                  File1.php:
                  
                  $query = //my query. 
                  $result = array();
                  $res = mysqli_query($conn, $query);
                  while($row = mysqli_fetch_array($res, MYSQL_NUM){
                      $result[] = $row;
                  }
                  $_SESSION['query2'] = $result;
                  
                  File2.php:
                  //I have already done session_start(); and initialized $conn
                  
                  $tempArray =  $_SESSION['query2'];
                  var_dump($tempArray);
                  

                  這篇關于使用 PHP SESSION 變量存儲 MySQL 查詢結果的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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. <small id='REoRP'></small><noframes id='REoRP'>

                        <tbody id='REoRP'></tbody>

                        • <legend id='REoRP'><style id='REoRP'><dir id='REoRP'><q id='REoRP'></q></dir></style></legend>
                          <i id='REoRP'><tr id='REoRP'><dt id='REoRP'><q id='REoRP'><span id='REoRP'><b id='REoRP'><form id='REoRP'><ins id='REoRP'></ins><ul id='REoRP'></ul><sub id='REoRP'></sub></form><legend id='REoRP'></legend><bdo id='REoRP'><pre id='REoRP'><center id='REoRP'></center></pre></bdo></b><th id='REoRP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='REoRP'><tfoot id='REoRP'></tfoot><dl id='REoRP'><fieldset id='REoRP'></fieldset></dl></div>
                        • <tfoot id='REoRP'></tfoot>
                          • <bdo id='REoRP'></bdo><ul id='REoRP'></ul>
                          • 主站蜘蛛池模板: 久久久久久久久久性 | 91麻豆精品国产91久久久久久久久 | 成人av网站在线观看 | 亚洲在线| 成人免费大片黄在线播放 | 97久久久 | 国产成人网 | 久久亚洲欧美日韩精品专区 | www.男人天堂.com | 成人不卡视频 | 在线免费观看a级片 | 亚洲欧美激情网 | 日韩av手机在线观看 | 三级视频在线观看 | 国产一区二区在线播放视频 | 欧美一级二级在线观看 | 久久久免费少妇高潮毛片 | www.久草.com | 成人亚洲性情网站www在线观看 | www成年人视频 | 成人精品区 | 91亚洲一区 | 九九热re | 国产欧美一区二区三区在线看蜜臀 | 日韩欧美精品一区 | 中文字幕在线三区 | 美女视频黄的 | 欧美一区二区免费 | 欧美午夜久久 | 欧美日在线 | 爱爱综合网 | 老外几下就让我高潮了 | 欧美一区二区在线 | 天堂一区二区三区 | 亚洲第一视频网站 | 91免费看片神器 | 日韩手机在线视频 | 在线观看中文字幕dvd播放 | 日韩有码一区 | 国产日韩精品一区二区三区 | 久久精品国产一区二区三区不卡 |