title: Join doesnt work properly with WHERE
body: <p>i have got a problem. I am trying to get ONLY users that last action was in 15 minutes. I am sure that my sql works when i dont use join(tried it), but when i add JOIN or LEFT, RIGHT or other JOINS I get all users, not only active in 15 minutes.
  Here is my code</p>
  
  <pre><code>function get_logged_users() {
  global $dbh;
  $users_info = $dbh-&gt;prepare(
      'SELECT
      users.username as `username`,
      users.id as `id`,
      ranks.style as `style`
      FROM `users` 
      LEFT JOIN `ranks` ON users.rank=ranks.id;
      WHERE users.last_login &gt; ?');
  $users_info-&gt;execute(array(date("Y-m-d H:i:s" ,strtotime( date("Y-m-d H:i:s")." -15 minutes" ))));
  $users_info = $users_info-&gt;fetchAll();
  return $users_info;
  </code></pre>
  
  <p>}</p>
  
  <p>Can anyone help me? :) Thanks!</p>
  
  <p>tables :
  <a href="http://i.stack.imgur.com/8MlRA.png" rel="nofollow">users</a></p>
  
  <p><a href="http://i.stack.imgur.com/6CzIv.png" rel="nofollow">ranks</a></p>