Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. echo "<tr>";
  2. echo "<td>".$count."</td>";
  3. echo "<td>".$row['prod_id']."</td>";
  4. echo "<td>".$row['prod_name']."</td>";
  5. echo "<td>".$row['prod_price']."</td>";
  6. echo "<td><form action='delete_prod.php' id='delete' method='get'>";
  7. echo "<input type='hidden' name='prod_id' value='".$row['prod_id']."' />";
  8. echo "<button type='submit' form = 'delete' class='btn btn-default' name='delete'>Delete</button>";
  9. echo "</form></td>";
  10. $count=$count+1;
  11. }
  12.  
  13. mysqli_free_result($rw);
  14. ?>
  15.  
  16. <?php
  17. if(isset($_GET['delete']))
  18. {
  19. include "connection.php";
  20. $prod_id=$_REQUEST['prod_id'];
  21. $del="delete from products where prod_id=$prod_id";
  22. if (mysqli_query($link,$del))
  23. {
  24. echo "Successfully deleted";
  25. unset($_POST['delete']);
  26. }
  27. else
  28. {
  29. echo "Delete operation Failed";
  30. }
  31. header('location:show_db.php');
  32. }
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement