title: PDO get user_id
body: <p>Okey, i have some trouble with my Login code..All work's great ,but when i try to get the row from my secound user ,it show me the row from the first user (i mean the information about the username,password,email,...).</p>
  
  <pre><code>public function login($username, $password){
      global $pdo;
  
      $query = $pdo-&gt;prepare("SELECT * FROM users WHERE username = ? AND password = ?");
      $query-&gt;bindValue(1, $username);
      $query-&gt;bindValue(2, $password);
  
      $query-&gt;execute();
  
      $result = $query-&gt;rowCount();
  
      if($result === 1){
      return true;
  
      } else {
      return false;
       }     
    }
  </code></pre>
  
  <p>I can't use mysql_result,but how i can get it like this ?</p>
  
  <pre><code> function user_id_from_username($username){
    return mysql_result(mysql_query("SELECT user_id FROM users WHERE username = $username"), 0, 'user_id');   
  }
  
  function login($username, $password){
    $user_id = user_id_from_username($username);
  
    return (mysql_result(mysql_query("SELECT COUNT(user_id) FROM users WHERE username = $username AND password = $password "),0) == 1)? $user_id : false;
  }
  </code></pre>
  
  <p>Sorry for my englsih ^^</p>