Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/>
- <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
- </head>
- <body>
- <nav class="navbar navbar-default">
- <div class="container-fluid">
- <a class="navbar navbar-brand">kura-kuracoding</a>
- </div>
- </nav>
- <div class="col-md-3"></div>
- <div class="col-md-6 well">
- <h3 class="text-primary">PHP - Remove Multiple Row using MySQLi</h3>
- <hr style="border-top:1px dotted #ccc;"/>
- <form method="POST" action="save.php">
- <div class="form-inline">
- <label>Firstname</label>
- <input type="text" name="firstname" class="form-control"/>
- </div>
- <br />
- <div class="form-inline">
- <label>Lastname</label>
- <input type="text" name="lastname" class="form-control"/>
- </div>
- <br />
- <div class="form-inline">
- <label>Gender</label>
- <input type="text" name="gender" class="form-control"/>
- </div>
- <br />
- <div class="form-inline">
- <label>Address</label>
- <input type="text" name="Address" class="form-control"/>
- </div>
- <br />
- <button class="btn btn-primary" name="save"><span class="glyphicon glyphicon-save"></span> Add</button>
- </form>
- <br />
- <table class="table table-bordered">
- <form method="POST" action="remove.php">
- <thead class="alert-info">
- <tr>
- <th>#</th>
- <th>Firstname</th>
- <th>Lastname</th>
- <th>Gender</th>
- <th>Address</th>
- </tr>
- </thead>
- <tbody>
- <?php
- require 'conn.php';
- $query = mysqli_query($conn, "SELECT * FROM `member` ORDER BY `lastname` ASC") or die(mysqli_error());
- while($fetch = mysqli_fetch_array($query)){
- ?>
- <tr>
- <td><input type="checkbox" name="mem_id[]" value="<?php echo $fetch['mem_id']?>"></td>
- <td><?php echo $fetch['firstname']?></td>
- <td><?php echo $fetch['lastname']?></td>
- <td><?php echo $fetch['gender']?></td>
- <td><?php echo $fetch['address']?></td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- <tfooter>
- <tr>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td><button class="btn btn-danger" name="remove">Remove</button></td>
- </tr>
- </tfooter>
- </form>
- </table>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement