Guest User

Untitled

a guest
Sep 2nd, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['submit'])){
  3. $hostname = 'localhost';
  4. $username = 'root';
  5. $password = '';
  6. $dbname= 'my_db';
  7.  
  8. $id = $_POST['id'];
  9. $connect = mysqli_connect('localhost','root','','my_db');
  10.  
  11. $query="DELETE FROM myguests WHERE id='.$id.'";
  12. $result = mysqli_query($connect, $query);
  13. if(result)
  14. {
  15. echo 'data deleted';
  16. }else{
  17. echo 'data not delete';
  18. }
  19. mysqli_close($connect);
  20. ?>
  21. <form action="Delete.php" method="POST">
  22. ID TO DELETE:&nbsp;<input type="text" name="id" required><br><br>
  23. <input type="submit" name="delete" value="clear data">
  24. </form>
Add Comment
Please, Sign In to add comment