Я ищу способ вернуть сообщение в моей форме, если отправленное письмо уже существует. я хочу 4-е, если будет выполнено
$conn = new PDO("mysql:host=localhost;dbname=ali","root","");
$sql = "insert into admin(id,email,password,repeatpass) values(null,?,?,?)";
$result = $conn->prepare($sql);
$result ->bindValue(1,$_POST["email"]);
$result ->bindValue(2,$_POST["pass"]);
$result ->bindValue(3,$_POST["repeat"]);
$number = $result->rowCount();
if (empty($_POST["email"]) or empty($_POST["pass"]) or empty($_POST["repeat"])){
echo "fill all the blanks";
}
else if(strlen($_POST["pass"]) < 6){
echo "password should not be less than 6 characters!";
}
else if($_POST["pass"] !== $_POST["repeat"]){
echo "passwords not matched";
}
else if($number > 0){
echo "is already exist";
}
else{
$result->execute();
echo "successfuly registered";
}