Check If Email Exists Php _top_ -
if ($count > 0) echo "Email already exists!"; else echo "Email is available.";
For this example, assume you have a database table named users with a column named email . check if email exists php
$result = mysqli_query($conn, "SELECT * FROM users WHERE email = '$email'"); if (mysqli_num_rows($result) > 0) ... if ($count > 0) echo "Email already exists
$dsn = "mysql:host=$host;dbname=$db;charset=$charset"; $options = [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, ]; if ($count >