php compare operator doesn't work as expected
i have a really strange problem. My Code:
$sql = "SELECT emailIsConfirmed FROM userdatabase.user where username =
'".mysqli_real_escape_string( $db, $username ) ."'";
$result = mysqli_query($db, $sql);
var_dump(mysqli_fetch_array($result)[0]);
var_dump("1");
if((mysqli_fetch_array($result)[0]) == "1")
{
return true;
}
return false;
doesn't work. Even when the output looks like this:
string(1) "1"
string(1) "1"
the result is false... Why?
I guess it is a really silly mistake.
Thanks for your help,
Vronsch
No comments:
Post a Comment