-5
I can’t make the query, when I try to make 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'];
?>
Which error is giving? in reality you have to put the two points ":" in the parameter.
$pdo->bindParam(":email", $email, PDO::PARAM_STR);
$pdo->bindParam(":senha", $senha, PDO::PARAM_STR);
– arllondias
Already tried, it returns this Pdostatement Object ( [queryString] => SELECT userid FROM user WHERE email=:email and password=:password )
– Renan Araújo
Yes, that’s because you’re giving one
print_r
in the object$pdo
, follow the flow that is to work yes– arllondias
Okay, obg. I got it
– Renan Araújo