title: mysqli_query gives empty value
body: <p>Im creating a login system for my website.
  I got the problem that my mysqli_query is empty:</p>
  
  <p>The code: <code>$r = mysqli_query($dbc, $q); returns empty.</code></p>
  
  <p>I think the problem is in the sql language that i pass it: </p>
  
  <pre><code>$q = "SELECT userid, fname, lname FROM User WHERE email='$e' AND pass=SHA1('$p')";
  </code></pre>
  
  <p>If i execute the sql above with the data that im actually is fetching from the form then i will get the result Im looking for. So i think its the php and sql combined that got an error.</p>
  
  <pre><code>if(empty($errors)){
      $q = "SELECT userid, fname, lname FROM User WHERE email='$e' AND pass=SHA1('$p')";
  
      $r = mysqli_query($dbc, $q);
      //Check for right data
      $errors[] = $e;
      $errors[] = $p;
      //Check if connection is up
      if($dbc != null){
          $errors[] = "Connection up";
      }
      //Check query
      if(is_null($r)){
          $errors[] = "Query is null";
      }
      //Check query for being empty
      if(empty($r)){
          $errors[] = "Its empty";
      }
      if( mysqli_num_rows($r) == 1){
          $row = mysqli_fetch_array($r, MYSQLI_ASSOC);
          return array(true, $row);
      }else{
          $errors[] = "Email address and password not found.";
      }
      return array(false, $errors);
  
  }
  </code></pre>