Error in SQL query with PDO

-5

I can not make the query, when I try to do it, I get the error:

Erro PDOStatement Object ( [queryString] => SELECT userid FROM usuario WHERE email=:email and senha=:senha )
<?php
require_once('conexao.php');
// @$email = $_POST['email'];
// @$senha = $_POST['senha'];
$email = "[email protected]";
$senha = "12346";

$pdo = $dbconn->prepare("SELECT userid FROM usuario WHERE email=:email and 
senha=:senha");
$pdo->bindParam("email", $email);
$pdo->bindParam("senha", $senha);
$pdo->execute();
print_r ($pdo);

$number = $pdo->fetchColumn();
// if($pdo->rowCount() == 1) {
//     $_SESSION['login'] = ['email'];

?>
    
asked by anonymous 14.03.2018 / 21:41

1 answer

-1

Getting resolved

  require_once('conexao.php');
  // @$email = $_POST['email'];
  // @$senha = $_POST['senha'];
  $email = "[email protected]";
  $senha = "12346";

  $pdo = $dbconn->prepare("SELECT userid FROM usuario WHERE email=:email and 
  senha=:senha");
  $pdo->bindParam(":email", $email);
  $pdo->bindParam(":senha", $senha); 
  $pdo->execute();
  // print_r ($pdo);

  $query = $pdo->fetchAll(PDO::FETCH_ASSOC);
  print_r ($query);
    
14.03.2018 / 22:01