Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "<tr>";
- echo "<td>".$count."</td>";
- echo "<td>".$row['prod_id']."</td>";
- echo "<td>".$row['prod_name']."</td>";
- echo "<td>".$row['prod_price']."</td>";
- echo "<td><form action='delete_prod.php' id='delete' method='get'>";
- echo "<input type='hidden' name='prod_id' value='".$row['prod_id']."' />";
- echo "<button type='submit' form = 'delete' class='btn btn-default' name='delete'>Delete</button>";
- echo "</form></td>";
- $count=$count+1;
- }
- mysqli_free_result($rw);
- ?>
- <?php
- if(isset($_GET['delete']))
- {
- include "connection.php";
- $prod_id=$_REQUEST['prod_id'];
- $del="delete from products where prod_id=$prod_id";
- if (mysqli_query($link,$del))
- {
- echo "Successfully deleted";
- unset($_POST['delete']);
- }
- else
- {
- echo "Delete operation Failed";
- }
- header('location:show_db.php');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement