php - Compare a $_SESSION with a variable -
i want compare $_session['email_of_user']
variable $r.
i've got code:
if ($result = $mysqli->query("select email users user_level = 1 ")) { $r = mysqli_fetch_array($result); } print_r($r); print_r($_session); if ($_session['email_of_user'] == $r) { /*something should happen, doesn't */}
in print_r correctly displayed , email of $_session
same $r
. why if ($_session['email_of_user'] == $r)
not working?
mysqli_fetch_array
fetch result row associative, numeric array, or both. comparing array
email. should use
if ($_session['email_of_user'] == $r['email'])
Comments
Post a Comment