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

<legend id='YwY75'><style id='YwY75'><dir id='YwY75'><q id='YwY75'></q></dir></style></legend>

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

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

        Mysqli 不允許多個查詢?

        Mysqli doesn#39;t allow multiple queries?(Mysqli 不允許多個查詢?)

            <tbody id='BsL2N'></tbody>
          1. <small id='BsL2N'></small><noframes id='BsL2N'>

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

                <tfoot id='BsL2N'></tfoot>

              • <legend id='BsL2N'><style id='BsL2N'><dir id='BsL2N'><q id='BsL2N'></q></dir></style></legend>
                  <bdo id='BsL2N'></bdo><ul id='BsL2N'></ul>
                  本文介紹了Mysqli 不允許多個查詢?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在 PHP 中運行一個腳本,該腳本使用循環(huán)為 MySQL 創(chuàng)建一個字符串查詢.

                  I am running a script in PHP that uisng a loop creates a string query for MySQL.

                  執(zhí)行腳本后出現(xiàn)以下錯誤:

                  After executing the script I get the following error:

                  您的 SQL 語法有錯誤;請查看手冊對應(yīng)于您的 MySQL 服務(wù)器版本以使用正確的語法'UPDATE BANNERS SET pos=1 WHERE BID=5; 附近更新橫幅集pos=2 WHERE BID=1' 在第 2 行"

                  "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE BANNERS SET pos=1 WHERE BID=5; UPDATE BANNERS SET pos=2 WHERE BID=1' at line 2"

                  在錯誤之后我回顯查詢,它看起來像這樣:

                  right after the error I echo the query and it looks like this:

                  UPDATE BANNERS SET pos=0 WHERE BID=6;
                  UPDATE BANNERS SET pos=1 WHERE BID=5;
                  UPDATE BANNERS SET pos=2 WHERE BID=1;
                  

                  當(dāng)我將其復(fù)制并粘貼到 phpmyadmin 中時,它顯然可以毫無問題地執(zhí)行.

                  When I copy and paste it into phpmyadmin, it obviously gets executed without any problem.

                  有什么想法嗎?

                  這是PHP代碼:

                  有一個看起來像這樣的數(shù)組:

                  There is an array that looks like this:

                  $order[0] = 'tr_6';
                  $order[1] = 'tr_5';
                  $order[2] = 'tr_1';
                  
                  $query = "";
                  
                  foreach($order as $pos => $value){
                     $idvalue = str_replace('tr_','',$value);
                     $query .= "UPDATE BANNERS  SET pos=$pos WHERE BID=$idvalue;
                  ";
                  }
                  
                  mysqli_query($connection,$query) or die(mysqli_error($connection)."<br/>$query");
                  

                  謝謝!

                  推薦答案

                  mysqli 允許使用 mysqli_multiple_query 函數(shù)進行多次查詢,如下所示:

                  mysqli allow multiple queries with mysqli_multiple_query function like this:

                  $query  = "SELECT CURRENT_USER();";
                  $query .= "SELECT Name FROM City ORDER BY ID LIMIT 20, 5";
                  
                  /* execute multi query */
                  if (mysqli_multi_query($link, $query)) {
                      do {
                          /* store first result set */
                          if ($result = mysqli_store_result($link)) {
                              while ($row = mysqli_fetch_row($result)) {
                                  printf("%s
                  ", $row[0]);
                              }
                              mysqli_free_result($result);
                          }
                          /* print divider */
                          if (mysqli_more_results($link)) {
                              printf("-----------------
                  ");
                          }
                      } while (mysqli_next_result($link));
                  }
                  

                  請注意,每次查詢后都需要使用分號.

                  note that you need to use semicolon after each query.

                  這篇關(guān)于Mysqli 不允許多個查詢?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

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

                  • <tfoot id='7JNIZ'></tfoot>
                    <legend id='7JNIZ'><style id='7JNIZ'><dir id='7JNIZ'><q id='7JNIZ'></q></dir></style></legend>

                      <tbody id='7JNIZ'></tbody>

                      <small id='7JNIZ'></small><noframes id='7JNIZ'>

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

                            主站蜘蛛池模板: 国产精品视频久久久久久 | 91porn国产成人福利 | 欧美在线成人影院 | 91人人在线 | 精品一区二区三区四区五区 | 久久精品99 | 国产精品91久久久久久 | 337p日本欧洲亚洲大胆精蜜臀 | 99福利视频导航 | 99在线观看视频 | 精品免费 | 理论片午午伦夜理片影院 | 日韩一区二区三区视频在线观看 | 91伊人网 | 日本午夜免费福利视频 | 伦理午夜电影免费观看 | 在线视频国产一区 | 天天操天天射综合 | 国产一区2区 | 亚洲毛片在线观看 | 91欧美精品成人综合在线观看 | 男女啪啪高潮无遮挡免费动态 | 午夜性色a√在线视频观看9 | 99久久夜色精品国产亚洲96 | 射欧美 | 欧美一区二区三区电影 | 午夜影院在线观看 | 欧美日批| 免费艹逼视频 | 鲁一鲁资源影视 | 欧美综合网 | 国产精品成人在线播放 | 久久免费资源 | 国产高清性xxxxxxxx | 欧美日韩在线观看一区 | 全部免费毛片在线播放网站 | 成人片在线看 | 黄色片亚洲| 韩日在线 | 在线视频国产一区 | 秋霞a级毛片在线看 |