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

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -