Hello, I'm starting with php already engaged in the PDO world and I have a question in my code
I want to check if the login exists and is the same one that was entered, if for returns "existing login" if not "login not exist"
Most every time is returning false.
Example below
require_once("conexao.php");
$sql = $conn->query("SELECT nome, senha FROM login where nome=? and senha=?");
$resultado = $conn->prepare($sql);
$resultado->bindParam(1, $_POST['nome']);
$resultado->bindParam(2, $_POST['senha']);
$resultado->execute();
if($resultado->fetch(PDO::FETCH_ASSOC) == true):
echo"existe login";
else:
echo"não existe login";
endif;
Can someone help me by following the PDO rule and inform me some examples with articles arguing about the subject.