久久久久久久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 多次插入的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我想知道準(zhǔn)備好的語句是否與具有多個(gè) 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 是在后臺(tái)優(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)行了一個(gè)測(cè)試,其中一個(gè)查詢使用準(zhǔn)備好的語句,另一個(gè)構(gòu)建整個(gè)查詢?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.

                  這是我的測(cè)試代碼.我在想準(zhǔn)備好的語句會(huì)阻止執(zhí)行,直到調(diào)用 $stmt->close() 來優(yōu)化它或其他東西.但情況似乎并非如此,因?yàn)槭褂?real_escape_string 構(gòu)建查詢的測(cè)試至少要快 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 多次插入的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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 只返回一個(gè)結(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()(致命錯(cuò)誤:調(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>

                          • 主站蜘蛛池模板: 国产高清精品网站 | 欧美激情欧美激情在线五月 | 成人不卡 | 久久综合影院 | 亚洲v日韩v综合v精品v | 黄色国产在线播放 | 久久97精品| 亚洲成人免费 | 中文字幕在线人 | 欧美精品久久久 | 欧美极品一区二区 | 91精品久久久久 | 美日韩免费视频 | 久久天天躁狠狠躁夜夜躁2014 | 国产亚洲一区二区在线观看 | 中文字幕视频三区 | 啪一啪| 中文字幕视频在线观看 | 91黄在线观看 | 午夜天堂精品久久久久 | 婷婷综合五月天 | 一级片av| 九九导航 | 国产三级在线观看播放 | 久久综合九九 | 国产一区二区不卡 | 亚洲手机在线 | 久久久久久久久淑女av国产精品 | 国产高清视频 | 久草久草久草 | 精品国产18久久久久久二百 | 欧洲一区二区三区 | 欧美最猛黑人xxxx黑人 | 久久人体视频 | 国产一区二区三区 | 日韩av网址在线观看 | 久久久久亚洲精品 | 蜜桃在线一区二区三区 | xnxx 日本免费 | 自拍偷拍av| 伊人春色成人网 |