Erro PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
Estou aprendendo PDO e ocorre um erro, que eu já passei horas procurando e não sei onde ele está, se algum puder me ajudar e explicar agradecido
Erro: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in C:\wamp64\www\teste\check_login.php on line 31
Código
<?php
session_start();
define('TENTATIVA_LOGIN', 5);
define('TEMPO_BLOQUEIO', 30);
require ("bcrypt.php");
require ("conexao.php");
$pdo = conectar();
if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] != "http://localhost:8080/Metta/html/login.php"):
echo "<script>alert('A requisição não foi feita pelo formulário de login');</script>";
echo "<script>window.history.back();</script>";
exit();
endif;
$email = trim(strip_tags($_POST['email_form']));
$senha = trim(strip_tags($_POST['senha_form']));
$hashForm = bcrypt::hash($senha);
$buscaSQL = $pdo->prepare('SELECT email FROM tbl_usuario WHERE email = ?');
$buscaSQL->execute(array($email));
if($buscaSQL->rowCount() == 0):
echo "<script>alert('O email digitado: ". $email. " não foi encontrado!');</script>";
echo "<script>window.history.back();</script>";
endif;
$busca_SQL = $pdo->prepare('SELECT email,senha FROM tbl_usuario WHERE email = ? AND senha = ?');
$buscaSQL->execute(array($email , $hashForm));
?>Discussão (1)
Carregando comentários...