久久久久久久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>

                          • 主站蜘蛛池模板: 亚洲不卡在线观看 | 一区视频在线免费观看 | 亚洲午夜精品在线观看 | 女人精96xxx免费网站p | 亚洲高清在线观看 | 国产精品视频网 | 91久久国产综合久久91精品网站 | 国产综合av | 九九九视频精品 | 国产精品久久久久久高潮 | 伊人在线视频 | 亚洲成人一区二区 | 国产免费一区二区三区 | 日日操夜夜操视频 | 成人免费观看视频 | 亚洲一区在线日韩在线深爱 | 影视先锋av资源噜噜 | 欧美一级免费观看 | 亚洲国产精品视频一区 | 日韩中文字幕在线视频观看 | 婷婷色网| 色www精品视频在线观看 | 日韩免费毛片视频 | av在线一区二区 | 久久亚洲美女 | 午夜久草 | 羞羞在线观看视频 | 看片一区 | 久久久精品一区二区三区 | 国产亚洲欧美在线视频 | 精品国产91亚洲一区二区三区www | 97伦理影院 | 久久av一区二区 | 久久久久99 | 一区二区三区亚洲视频 | 欧美精品久久久 | 久久精品亚洲精品 | 亚洲高清在线观看 | 久久久久国产精品人 | 人人玩人人干 | 亚洲一区二区在线播放 |