Guest User

Untitled

a guest
Feb 7th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <form action = "<?php $_PHP_SELF ?>" method = "POST">
  2. Profile = <input type = "text" name = "profile" />
  3. <input type = "submit" />
  4. </form>
  5.  
  6. <?php
  7.  
  8. $servername = "localhost";
  9. $username = "root";
  10. $password = "root";
  11. $dbname = "registration";
  12.  
  13. $conn = new mysqli($servername, $username, $password, $dbname);
  14.  
  15. if ($conn->connect_error) {
  16. die("Connection failed: " . $conn->connect_error);
  17. }
  18.  
  19. $query = "DELETE FROM users WHERE id= profile";
  20.  
  21. if ($conn->query($sql) === TRUE) {
  22. echo "Profile deleted successfully";
  23. } else {
  24. echo "Error deleting profile: " . $conn->error;
  25. }
  26.  
  27. ?>
Add Comment
Please, Sign In to add comment