title: Facebook FQL query to get all users online
body: <p>I keep record of all users of my app in local, MySQL database. I have all the relevant information required to get user online presence status [<code>UID, access_token</code> and granted <code>extended permission</code>]. </p>
  
  <p><strong>How do I get online presence status of all users?</strong></p>
  
  <p>The approach I am using at the moment, is to query each user separately:</p>
  
  <pre><code>$facebook-&gt;api(array
  (
      'access_token'  =&gt; 'x',
      'method'        =&gt; 'fql.query',
      'query'     =&gt; "SELECT uid, name, first_name, last_name, online_presence FROM user WHERE uid = x"
  ));
  </code></pre>
  
  <p>But this is time taking procedure with 150 users. I am not even talking about 400+ or 1000+.</p>
  
  <p>p.s. multiquery didn't work for me, because asking user presence requires to provide the <code>access_token</code>.</p>