0
Hello, I have a problem, I would like to know about prepared sentences, I have this code:
$query_email = ("SELECT email FROM usuarios_ WHERE email = ?");
$stmt = mysqli_stmt_init($conn);
if (mysqli_stmt_prepare($stmt, $query_email)) {
mysqli_stmt_bind_param($stmt, 's', $email);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $resultado);
mysqli_stmt_fetch($stmt);
echo $resultado;
mysqli_stmt_close($stmt);
}
So far so good, my question is, how to know if it worked or not, because as it is a login system I have to pass the return to the user if the email exists or not.
Your code looks right, what’s the problem? or you want the number of rows returned?
– rray
Ray,, I needed to know if the query had records or not, ie if she found the email provided by the user.
– Dunga Cardoso