+ 2
PHP adress check
Hi, I want to check on mySQL Database if a mail adress exist or not. How can we code that with PHP (and SQL if we need it). Like a connexion validation, we search if the email exists on the Database then we redirect the user into the profil or we send him an error if the email is not valid (don't exists on the DB)
2 odpowiedzi
+ 9
Count the amount of rows
$pre = $conn->prepare(”SELECT id FROM address WHERE address=:address”);
$pre->bindParam(”:address”, ”value”);
$pre->execute();
if($pre->rowCount()) {
header(”location: /profile”);
} else {
die(”error”);
}
+ 1
Thank you so much