Guest User

Untitled

a guest
Nov 19th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. $id = $_POST["id"];
  2. if(!is_string($id) && !empty($id)) {
  3. $delete = mysqli_query($connect,"DELETE from users WHERE ID=$id");
  4. $_SESSION["succMsg"] = "User have been successfully removed";
  5. Header("Location:login_update.php");
  6. } else {
  7. $_SESSION["succMsg"] = "Unable to execute the query.";
  8. Header("Location:login_update.php");
  9. }
  10.  
  11. $id = (int) $_POST["id"];
  12.  
  13. if (isset($_POST["id"])) {
  14. $id = (int) $_POST["id"];
  15. // Do your query....
  16. }
  17.  
  18. function addOptions()
  19. {
  20. global $connect;
  21. $result = mysqli_query($connect,"SELECT * FROM users ORDER BY ID ASC");
  22. while ($row = mysqli_fetch_assoc($result)) {
  23. $id = $row["id"];
  24. echo "<option value='$id'>$id</option>";
  25. }
  26. }
  27.  
  28. function addOptions()
  29. {
  30. global $connect;
  31. $result = mysqli_query($connect,"SELECT * FROM users ORDER BY ID ASC");
  32. while ($row = mysqli_fetch_assoc($result)) {
  33. $id = $row["id"];
  34. echo "<option value="".$id."">$id</option>";
  35. }
  36. }
Add Comment
Please, Sign In to add comment