Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Created by PhpStorm.
  5. * User: Hacker
  6. * Date: 19/08/2017
  7. * Time: 08:45
  8. */
  9. class login extends Models
  10. {
  11. private $email;
  12. private $acc;
  13. private $pass;
  14.  
  15. public function setAccount($e, $ac, $pw)
  16. {
  17. $this->email = $e;
  18. $this->acc = $ac;
  19. $this->pass = $pw;
  20. }
  21.  
  22. public function getEm()
  23. {
  24. return $this->email;
  25. }
  26.  
  27. public function getAc()
  28. {
  29. return $this->acc;
  30. }
  31.  
  32. public function getPass()
  33. {
  34. return $this->pass;
  35. }
  36.  
  37. public function getAccountBoolean()
  38. {
  39.  
  40. $this->getEm();
  41. $this->getAc();
  42. $this->getPass();
  43.  
  44. try {
  45. $sql = " SELECT account,email,id,password FROM user WHERE ( email = '$this->email' OR account = '$this->acc') AND password = '$this->pass';";
  46.  
  47. $sql = $this->db->prepare($sql);
  48. $sql->execute();
  49. if ($Dat = $sql->fetch()) {
  50. return $Dat['id'];
  51. }
  52.  
  53.  
  54. } catch (PDOException $e) {
  55. return 0;
  56. }
  57. }
  58.  
  59.  
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement