Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Created by PhpStorm.
- * User: Hacker
- * Date: 19/08/2017
- * Time: 08:45
- */
- class login extends Models
- {
- private $email;
- private $acc;
- private $pass;
- public function setAccount($e, $ac, $pw)
- {
- $this->email = $e;
- $this->acc = $ac;
- $this->pass = $pw;
- }
- public function getEm()
- {
- return $this->email;
- }
- public function getAc()
- {
- return $this->acc;
- }
- public function getPass()
- {
- return $this->pass;
- }
- public function getAccountBoolean()
- {
- $this->getEm();
- $this->getAc();
- $this->getPass();
- try {
- $sql = " SELECT account,email,id,password FROM user WHERE ( email = '$this->email' OR account = '$this->acc') AND password = '$this->pass';";
- $sql = $this->db->prepare($sql);
- $sql->execute();
- if ($Dat = $sql->fetch()) {
- return $Dat['id'];
- }
- } catch (PDOException $e) {
- return 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement