Advertisement
Hadi1989

Untitled

Jan 22nd, 2019
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.32 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.     <head>
  4.         <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/>
  5.         <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
  6.     </head>
  7. <body>
  8.     <nav class="navbar navbar-default">
  9.         <div class="container-fluid">
  10.             <a class="navbar navbar-brand">kura-kuracoding</a>
  11.         </div>
  12.     </nav>
  13.     <div class="col-md-3"></div>
  14.     <div class="col-md-6 well">
  15.         <h3 class="text-primary">PHP - Remove Multiple Row using MySQLi</h3>
  16.         <hr style="border-top:1px dotted #ccc;"/>
  17.         <form method="POST" action="save.php">
  18.             <div class="form-inline">
  19.                 <label>Firstname</label>
  20.                 <input type="text" name="firstname" class="form-control"/>
  21.             </div>
  22.             <br />
  23.             <div class="form-inline">
  24.                 <label>Lastname</label>
  25.                 <input type="text" name="lastname" class="form-control"/>
  26.             </div>
  27.             <br />
  28.             <div class="form-inline">
  29.                 <label>Gender</label>
  30.                 <input type="text" name="gender" class="form-control"/>
  31.             </div>
  32.             <br />
  33.             <div class="form-inline">
  34.                 <label>Address</label>
  35.                 <input type="text" name="Address" class="form-control"/>
  36.             </div>
  37.             <br />
  38.             <button class="btn btn-primary" name="save"><span class="glyphicon glyphicon-save"></span> Add</button>
  39.         </form>
  40.         <br />
  41.         <table class="table table-bordered">
  42.             <form method="POST" action="remove.php">
  43.                 <thead class="alert-info">
  44.                     <tr>
  45.                         <th>#</th>
  46.                         <th>Firstname</th>
  47.                         <th>Lastname</th>
  48.                         <th>Gender</th>
  49.                         <th>Address</th>
  50.                     </tr>
  51.                 </thead>
  52.                 <tbody>
  53.                     <?php
  54.                         require 'conn.php';
  55.  
  56.                         $query = mysqli_query($conn, "SELECT * FROM `member` ORDER BY `lastname` ASC") or die(mysqli_error());
  57.                         while($fetch = mysqli_fetch_array($query)){
  58.                     ?>
  59.                     <tr>
  60.                         <td><input type="checkbox" name="mem_id[]" value="<?php echo $fetch['mem_id']?>"></td>
  61.                         <td><?php echo $fetch['firstname']?></td>
  62.                         <td><?php echo $fetch['lastname']?></td>
  63.                         <td><?php echo $fetch['gender']?></td>
  64.                         <td><?php echo $fetch['address']?></td>
  65.                     </tr>
  66.                     <?php
  67.                         }
  68.                     ?>
  69.                 </tbody>
  70.                 <tfooter>
  71.                     <tr>
  72.                         <td></td>
  73.                         <td></td>
  74.                         <td></td>
  75.                         <td></td>
  76.                         <td><button class="btn btn-danger" name="remove">Remove</button></td>
  77.                     </tr>
  78.                 </tfooter>
  79.             </form>
  80.         </table>
  81.     </div>
  82. </body>
  83. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement