Request help, I am using PHP 8 and am facing an issue with the if else statement.
1.) If $uname==$username is correct, the echo Confirmed is showing.
2.) If $uname is not equal to $username then the display is blank, and the else statement is not working and the echo Not Confirmed does not display.
code is as follows:
$sql = "SELECT * FROM staff WHERE staff_name='$uname' ";
$result = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_assoc($result)) {
$staffname=$row['staff_name'];
$password= $row['password'];
if ($uname===$staffname) {
echo "Confirmed";
}
else {
echo " Not Confirmed";
}
}