Advertisement
Guest User

Untitled

a guest
May 3rd, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2.  
  3. require_once 'includes/constants.php';
  4.  
  5. class Mysql {
  6. private $conn;
  7.  
  8. function __construct() {
  9. $this->conn = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME) or
  10. die('Problema conectando con la base de datos.');
  11. }
  12.  
  13. function verify_Username_and_Pass($un, $pwd) {
  14.  
  15. $query = "SELECT *
  16. FROM Usuarios
  17. WHERE User = ? AND Password = ?
  18. LIMIT 1";
  19.  
  20. if($stmt = $this->conn->prepare($query)) {
  21. $stmt->bind_param('ss', $un, $pwd);
  22. $stmt->execute();
  23.  
  24. if($stmt->fetch()) {
  25. $stmt->close();
  26. return true;
  27. }
  28. }
  29.  
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement