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

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

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

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

      1. <tfoot id='h3LnQ'></tfoot>
          <bdo id='h3LnQ'></bdo><ul id='h3LnQ'></ul>
      2. PHP MySQLi 多次插入

        PHP MySQLi Multiple Inserts(PHP MySQLi 多次插入)

        <small id='52u8Q'></small><noframes id='52u8Q'>

          <legend id='52u8Q'><style id='52u8Q'><dir id='52u8Q'><q id='52u8Q'></q></dir></style></legend>
            <bdo id='52u8Q'></bdo><ul id='52u8Q'></ul>
                <tbody id='52u8Q'></tbody>
              1. <tfoot id='52u8Q'></tfoot>

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

                1. 本文介紹了PHP MySQLi 多次插入的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我想知道準(zhǔn)備好的語句是否與具有多個 VALUES 的普通 mysql_query 工作相同.

                  I'm wondering if prepared statements work the same as a normal mysql_query with multiple VALUES.

                  INSERT INTO table (a,b) VALUES ('a','b'), ('c','d');
                  

                  VS

                  $sql = $db->prepare('INSERT INTO table (a,b) VALUES (?, ?);
                  

                  如果我在循環(huán)中使用準(zhǔn)備好的語句,MySQL 是在后臺優(yōu)化插入以使其像在那里的第一段代碼中一樣工作,還是就像在循環(huán)中運(yùn)行第一段代碼一樣每次值?

                  If I use the prepared statement in a loop, is MySQL optimizing the insert in the background to work like it would in the first piece of code there, or is it just like running the first piece of code inside a loop with one value each time ?

                  推薦答案

                  我繼續(xù)進(jìn)行了一個測試,其中一個查詢使用準(zhǔn)備好的語句,另一個構(gòu)建整個查詢?nèi)缓髨?zhí)行該查詢.我可能沒有讓我想知道的內(nèi)容易于理解.

                  I went ahead and ran a test where one query uses a prepared statement, and the other builds the entire query then executes that. I'm probably not making what I'm wanting to know easy to understand.

                  這是我的測試代碼.我在想準(zhǔn)備好的語句會阻止執(zhí)行,直到調(diào)用 $stmt->close() 來優(yōu)化它或其他東西.但情況似乎并非如此,因?yàn)槭褂?real_escape_string 構(gòu)建查詢的測試至少要快 10 倍.

                  Here's my test code. I was thinking prepared statements sort of held back execution until a $stmt->close() was called to optimize it or something. That doesn't appear to be the case though as the test that builds the query using real_escape_string is at least 10 times faster.

                  <?php
                  
                  $db = new mysqli('localhost', 'user', 'pass', 'test');
                  
                  $start = microtime(true);
                  $a = 'a';
                  $b = 'b';
                  
                  $sql = $db->prepare('INSERT INTO multi (a,b) VALUES(?, ?)');
                  $sql->bind_param('ss', $a, $b);
                  for($i = 0; $i < 10000; $i++)
                  {
                      $a = chr($i % 1);
                      $b = chr($i % 2);
                      $sql->execute();
                  }
                  $sql->close();
                  
                  echo microtime(true) - $start;
                  
                  $db->close();
                  
                  ?>
                  

                  這篇關(guān)于PHP MySQLi 多次插入的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  store_result() and get_result() in mysql returns false(mysql 中的 store_result() 和 get_result() 返回 false)
                  Call to undefined function mysqli_result::num_rows()(調(diào)用未定義的函數(shù) mysqli_result::num_rows())
                  PHP Prepared Statement Problems(PHP 準(zhǔn)備好的語句問題)
                  mysqli_fetch_array returning only one result(mysqli_fetch_array 只返回一個結(jié)果)
                  How do I make sure that values from MySQL keep their type in PHP?(如何確保 MySQL 中的值在 PHP 中保持其類型?)
                  Fatal error: Call to undefined method mysqli::error()(致命錯誤:調(diào)用未定義的方法 mysqli::error())
                    <bdo id='uCFTu'></bdo><ul id='uCFTu'></ul>

                            <tbody id='uCFTu'></tbody>
                          <tfoot id='uCFTu'></tfoot>
                          <legend id='uCFTu'><style id='uCFTu'><dir id='uCFTu'><q id='uCFTu'></q></dir></style></legend>

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

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

                          • 主站蜘蛛池模板: 日韩一区二区三区在线视频 | 欧美精品在欧美一区二区 | 欧美一区二区三区大片 | 亚洲国产精品久久久久秋霞不卡 | 精品亚洲一区二区 | 日韩欧美精品在线 | 综合久久av | 99精品国产一区二区青青牛奶 | 午夜欧美| 国产精品178页| 天堂精品| 一级毛片免费 | 青青草在线播放 | 丁香婷婷在线视频 | 欧美福利 | 在线观看黄色大片 | 91伦理片 | 精品一区二区三区在线观看国产 | 国产91久久精品一区二区 | 国产高清久久 | 久久久国产一区二区三区四区小说 | 久久精品久久综合 | 国产精品高清一区二区 | 91精品国产高清一区二区三区 | 青青草原综合久久大伊人精品 | 久久免费精品 | h视频在线观看免费 | 97国产一区二区 | 手机看片在线播放 | 亚洲最大的黄色网址 | 欧美激情综合色综合啪啪五月 | 国产日韩一区 | 中国美女一级黄色片 | 综合久| 免费av在线| 色播av | 欧美中文在线 | 久久久久久久一区二区三区 | 视频在线一区 | 亚洲高清视频一区 | 亚洲成人免费视频在线 |