I am making a login system. In the table is registered a user "UseR01" , when the client will log in if he put in the "user01" field I want you to validate anyway.
Here's the code I'm using.
$Name = mysqli_real_escape_string($conn, $_POST['Name']);
$Pass = mysqli_real_escape_string($conn, $_POST['Pass']);
$PassMD5 = md5($Pass);
$result1 = "SELECT * FROM users WHERE username = '$Name' && userpass = '$PassMD5' LIMIT 1";
$result2 = mysqli_query($conn, $result1);
$result3 = mysqli_fetch_assoc($result2);
if(isset($result3)){
echo "SUCCESS";
}else{
echo "FAIL";
}