Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- protected $Conecta;
- private $host = "localhost";
- private $dbname = "classificados";
- private $user = "root";
- private $pass = "";
- public function __construct() {
- try {
- $this->Conecta = new PDO("mysql:host={$this->host};dbname={$this->dbname}", "{$this->user}", "{$this->pass}");
- return $this->Conecta;
- } catch (PDOException $e) {
- echo $e->getMessage();
- }
- }
- <?php
- private $verificaUser;
- public function setUsuario($email, $senha) {
- $this->verificaUser = parent::prepare("SELECT email, senha FROM usuarios WHERE cl_email = :email AND senha = :senha");
- $this->verificaUser->bindValue(":email", $email);
- $this->verificaUser->bindValue(":senha", $senha);
- $this->verificaUser->execute();
- return $this->verificaUser->rowCount();
- }
- public function getUsuario() {
- return $this->setUsuario();
- }
- Fatal error: Uncaught Error: Call to undefined method Conexao::prepare() in /opt/lampp/htdocs/classificados/model/Sessao.class.php:10 Stack trace: #0 /opt/lampp/htdocs/classificados/model/Sessao.class.php(24): Sessao->setUsuario('fulano@bol.com', '123') #1 {main} thrown in /opt/lampp/htdocs/classificados/model/Sessao.class.php on line 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement