title: php mysql where statement with AND return true even if the second condition is false
body: <p>I am running a mysql statement which actually evaluates to true despite the incorrectness of a value. Bellow is the function</p>
  
  <pre><code>&lt;?php
  public function login_user($username, $password){
  
        if(!empty($username) &amp;&amp; !empty($password)){
          $sql = "SELECT * FROM `users` WHERE `user_name`='$username' AND `user_password`='$password'";
          $query = $this-&gt;link-&gt;query($sql);
  
          if($this-&gt;link-&gt;error){
              //return false;
              $this-&gt;log_db_error($this-&gt;link-&gt;error, $sql);
              return false;
          }
          else{
  
              return true;
          }
      }
      else{
        return false;
      }
    }
  ?&gt;
  </code></pre>
  
  <p>Calling this function with the params and passing a correct username and a wrong password actually returns true, where am I messing up? Any help </p>