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

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

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

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

      1. 將刪除按鈕添加到 PHP 結果表

        Add Delete Button to PHP results table(將刪除按鈕添加到 PHP 結果表)

          <small id='6Fl6x'></small><noframes id='6Fl6x'>

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

                • 本文介紹了將刪除按鈕添加到 PHP 結果表的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我已將 MySQL 表的結果輸出到 HTML 表.在最后一列中,我想添加一個刪除選項,它調用另一個表單并刪除用戶.我似乎無法讓它工作.

                  I have outputted the results of a MySQL table to an HTML table. In the last column, I want to add a delete option which calls another form and deletes the user. I can't seem to get it to work though.

                  這是我的結果頁面代碼:

                  This is my code for the results page:

                  <?php
                  
                      $contacts = mysql_query("
                          SELECT * FROM contacts ORDER BY ID ASC") or die( mysql_error() );
                  
                      // If results
                      if( mysql_num_rows( $contacts ) > 0 )
                      ?>
                  
                      <table id="contact-list">
                          <thead>
                              <tr>
                                  <th>Name</th>
                                  <th>Email</th>
                                  <th>Telephone</th>
                                  <th>Address</th>
                    <th>Delete</th>
                              </tr>
                          </thead>
                          <tbody>
                  
                          <?php while( $contact = mysql_fetch_array( $contacts ) ) : ?>
                  
                  
                  
                              <tr>
                                  <td class="contact-name"><?php echo $contact['name']; ?></td>
                                  <td class="contact-email"><?php echo $contact['email']; ?></td>
                                  <td class="contact-telephone"><?php echo $contact['telephone']; ?></td>
                                  <td class="contact-address"><?php echo $contact['address']; ?></td>
                                  <td class="contact-delete"><form action='delete.php' method="post">
                  <input type="hidden" name="name" value="">
                  <input type="submit" name="submit" value="Delete">
                  </form></td>                
                              </tr>
                  
                          <?php endwhile; ?>
                  
                          </tbody>
                      </table>
                  

                  而且,這是我的 delete.php 腳本

                  and, this is my delete.php script

                  <?php
                  
                  //Define the query
                  $query = "DELETE FROM contacts WHERE name={$_POST['name']} LIMIT 1";
                  
                  //sends the query to delete the entry
                  mysql_query ($query);
                  
                  if (mysql_affected_rows() == 1) { 
                  //if it updated
                  ?>
                  
                              <strong>Contact Has Been Deleted</strong><br /><br />
                  
                  <?php
                   } else { 
                  //if it failed
                  ?>
                  
                              <strong>Deletion Failed</strong><br /><br />
                  
                  
                  <?php
                  } 
                  ?>
                  

                  很確定我只是遺漏了一些東西,但我不知道那是什么:(

                  Pretty sure I'm just missing something, but I can't figure out what that is :(

                  推薦答案

                  您必須在刪除鏈接中傳遞變量.你必須通過 <?php echo $contact['name'];?> 隱藏字段中的名稱值或在 URL

                  You have to pass variable in delete link. You must have to pass <?php echo $contact['name']; ?> name value in hidden field or pass this value in URL

                  替換

                  <td class="contact-delete">
                        <form action='delete.php' method="post">
                        <input type="hidden" name="name" value="">
                        <input type="submit" name="submit" value="Delete">
                        </form>
                  </td>
                  

                  隨著

                  <td class="contact-delete">
                      <form action='delete.php?name="<?php echo $contact['name']; ?>"' method="post">
                          <input type="hidden" name="name" value="<?php echo $contact['name']; ?>">
                          <input type="submit" name="submit" value="Delete">
                      </form>
                  </td>
                  

                  這篇關于將刪除按鈕添加到 PHP 結果表的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 找不到驅動程序)
                  <i id='qP718'><tr id='qP718'><dt id='qP718'><q id='qP718'><span id='qP718'><b id='qP718'><form id='qP718'><ins id='qP718'></ins><ul id='qP718'></ul><sub id='qP718'></sub></form><legend id='qP718'></legend><bdo id='qP718'><pre id='qP718'><center id='qP718'></center></pre></bdo></b><th id='qP718'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='qP718'><tfoot id='qP718'></tfoot><dl id='qP718'><fieldset id='qP718'></fieldset></dl></div>
                  • <tfoot id='qP718'></tfoot>

                  • <small id='qP718'></small><noframes id='qP718'>

                  • <legend id='qP718'><style id='qP718'><dir id='qP718'><q id='qP718'></q></dir></style></legend>
                        <tbody id='qP718'></tbody>

                          • <bdo id='qP718'></bdo><ul id='qP718'></ul>
                            主站蜘蛛池模板: 国产一级免费在线观看 | 黄色网址在线播放 | 久久久久网站 | 国产精品国产精品国产专区不卡 | 国产成人久久精品一区二区三区 | 2019天天干天天操 | 天天操夜夜艹 | 九一视频在线播放 | 国产成人jvid在线播放 | 日韩av一区二区在线观看 | 国产成人一区二区三区久久久 | 91精品国产91综合久久蜜臀 | 在线色网 | 国产日韩精品一区二区 | 亚洲美女天堂网 | 欧美一区二区三区四区五区无卡码 | 久久福利网站 | 91精品国产91久久久久久吃药 | 国产成人精品一区二区三区网站观看 | 精品国产视频 | 九九热免费在线观看 | 久久精品亚洲精品国产欧美 | 999久久精品 | 亚洲福利在线观看 | 国产欧美日韩久久久 | 91精品久久久久久久99 | 亚洲精品一区二区三区丝袜 | 日本天堂视频 | 亚洲一区在线观看视频 | 一区二区三区不卡视频 | 超碰97人人人人人蜜桃 | 99热视| 久久99精品久久久久久国产越南 | 国产精品久久久久久久久久 | 毛片a级毛片免费播放100 | 欧美精品一区二区三区在线 | 51ⅴ精品国产91久久久久久 | 久久久国产精品一区 | 欧美日韩精品久久久免费观看 | 高清视频一区二区三区 | 九九99久久 |