title: PHP function not returning TRUE
body: <p>I am trying to create a function that will check if a user is subscribed or not, but the code doesn't work, it doesn't return <code>TRUE</code> even if the user is subscribed.</p>
  
  <p>Here is an example of my code.</p>
  
  <pre><code>function is_subscribed($email)
  {
      global $DBC;
  
      $result = mysqli_query($DBC,"SELECT * FROM users WHERE email = $email");
  
      if(mysqli_num_rows($result) &gt; 0) {
          while($row = mysqli_fetch_array($result)) {
              if($row['subscribed'] == 'yes') { 
                  return TRUE; 
              } else {
                  return FALSE;
              }
          }
      }
  }
  
  $user_email = $_SESSION['email'];
  
  if(is_subscribed($user_email)) {
      echo "YES!";
  }
  </code></pre>