Advertisement
Guest User

Untitled

a guest
Mar 13th, 2017
70
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.  
  3.  
  4. require_once 'constants.php';
  5.  
  6. class Mysql {
  7. private $conn;
  8.  
  9. function __construct()
  10. {
  11. $this->conn = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME) or die('There was a problem connecting to the database');
  12. }
  13.  
  14. function verify_user_pass($un, $pwd)
  15. {
  16. $query = "SELECT * FROM Users WHERE Username = ? AND Password = ? LIMIT 1";
  17.  
  18. if($stmt = $this->conn->prepare($query))
  19. {
  20. $stmt->bind_param('ss', $un, $pwd);
  21. $stmt->execute();
  22.  
  23. if($stmt->fetch())
  24. {
  25. $stmt->close();
  26. return true;
  27. }
  28. }
  29. }
  30. }
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement