php check if user exists in database
$q = mysql_query("SELECT username FROM User WHERE username=$username", $cnn); if (mysql_num_rows($q) != 0) { echo "Username exists"; } else { echo "Write your code here"; }
php check if user exists in database
$q = mysql_query("SELECT username FROM User WHERE username=$username", $cnn); if (mysql_num_rows($q) != 0) { echo "Username exists"; } else { echo "Write your code here"; }
how to check if username already exists in php
$firstname = $_POST["firstname"];
$lastname = $_POST["lastname"];
$email = $_POST["email"];
$pass = $_POST["password"];
$check_email = mysqli_query($conn, "SELECT Email FROM crud where Email = '$email' ");
if(mysqli_num_rows($check_email) > 0){
echo('Email Already exists');
}
else{
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$result = mysqli_query($conn, "INSERT INTO crud (Firstname, Lastname, Email, Password) VALUES ('$firstname', '$lastname', '$email', '$pass')");
}
echo('Record Entered Successfully');
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us