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

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

    • <bdo id='xU0tZ'></bdo><ul id='xU0tZ'></ul>

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

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

        使用 PDO 插入多行

        Insert multiple rows with PDO(使用 PDO 插入多行)
      1. <small id='NNasd'></small><noframes id='NNasd'>

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

            <tbody id='NNasd'></tbody>
            <bdo id='NNasd'></bdo><ul id='NNasd'></ul>

                  本文介紹了使用 PDO 插入多行的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我在

                  標簽中有一個多復選框,如下所示:

                  I have a multicheckbox in a <form> tag like this:

                  <input type="checkbox" name="del[]" value="<?php echo $menuItems['id']; ?>">
                  

                  我使用此代碼詢問此表單:

                  I ask this form with this code:

                  if (isset($_POST['subgruppe'])) {
                          $ids = array();
                  
                      foreach ($_POST['del'] as $pval) {
                          $ids[] = (int) $pval;
                      }
                  
                      $ids = implode(',', $ids);
                      echo "groupids";
                      echo $ids;
                      echo "userid:";
                      echo $_POST['userid'];
                  

                  這向我展示了這樣的結果:

                  This shows me a result like this:

                  groupids13,9...userid:5 
                  

                  我需要一個給我這樣結??果的語句:

                  I need a statment that give me a result like this:

                  INSERT INTO user_groups (usergroup, userid) VALUE (13,5),(9,5)
                  

                  ...你能給我一個提示我如何檢查這個嗎?我想我可以解決一個給我的解決方案:(13,5),(9,5)... 變成一個變量.

                  ... Can you give me a hint how i can check this? I think I can handel a solution that give me: (13,5),(9,5)... into a variable.

                  非常感謝:)

                  推薦答案

                  您不必為所有 INSERTS 構建單個字符串,只需在循環時插入即可.

                  You don't have to build a single string for all of your INSERTS simply insert while you are looping.

                  例如:

                  $sql = "INSERT INTO user_groups (usergroup, userid) VALUE (:usergroup, :userid)";
                  $stmt = $pdo->prepare($sql);
                  foreach ($_POST['del'] as $pval) {
                      $stmt->execute(array(':usergroup'=>(int) $pval, 
                                           ':userid'=>$_POST['userid']
                      ));
                  }
                  

                  這篇關于使用 PDO 插入多行的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

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

                  <legend id='5iumW'><style id='5iumW'><dir id='5iumW'><q id='5iumW'></q></dir></style></legend>

                      <tfoot id='5iumW'></tfoot>
                        <bdo id='5iumW'></bdo><ul id='5iumW'></ul>
                            <tbody id='5iumW'></tbody>

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

                            主站蜘蛛池模板: 免费在线精品视频 | 欧美电影在线观看网站 | 久久99精品久久久久婷婷 | 2一3sex性hd | www.99re| www.日本三级| 亚洲精品美女在线观看 | 亚洲精品中文字幕av | 久久机热 | 男人天堂网址 | 欧美成人精品一区二区男人看 | 日韩国产中文字幕 | 免费观看的av | 中文字幕免费在线 | 亚洲一区二区三区免费视频 | 亚洲精品视频在线看 | 免费在线观看一区二区 | 成人免费淫片aa视频免费 | 成人午夜看片 | 亚洲黄色视屏 | 国产亚洲一区二区三区在线观看 | 久久久久久久国产精品影院 | 黄网站在线观看 | 国产精品久久久久久久午夜 | 超碰av在线| 久久大陆 | 日本在线看| aaaaaaa片毛片免费观看 | 亚洲国产一区二区三区四区 | 在线视频一区二区 | av免费观看在线 | 免费看淫片 | 每日在线更新av | 色先锋影音 | 波多野结衣亚洲 | 日韩国产免费观看 | 亚洲三级在线 | av毛片 | 日本一二三区电影 | 中文字幕在线一区二区三区 | 欧美日韩一区二区在线 |