title: Score facebook friends
body: <pre><code>    $app_using_friends = $facebook-&gt;api(array(
          'method' =&gt; 'fql.query',
          'query' =&gt; 'SELECT uid, name FROM user WHERE uid IN(SELECT uid2 FROM friend WHERE uid1 = me()) AND is_app_user = 1'
  
        ));
  
         echo '&lt;pre&gt;';
        print_r("query results:");
        print_r($app_using_friends);
        echo '&lt;/pre&gt;';
  
  
      foreach($app_using_friends as $fl){
  
          echo "&lt;li&gt;".$fl['name']."&lt;/li&gt;";        
          $result = mysql_query("SELECT * FROM user WHERE fb_id = " . $fl['uid']);
      while ($row = mysql_fetch_array($result)) {
         $test = $row{'fb_score'};
         echo "score:".$row{'fb_score'}."&lt;br&gt;";
      }
      }
  
  
  query results:Array
  (
    [0] =&gt; Array
    (
      [uid] =&gt; 100004375809
      [name] =&gt; Brat
    )
  
    [1] =&gt; Array
    (
      [uid] =&gt; 100005832212
      [name] =&gt; Vit
    )
  
    [2] =&gt; Array
    (
      [uid] =&gt; 100005832323
      [name] =&gt; Ala
    )
  
  )
  </code></pre>
  
  <blockquote>
    <p>Brat<br>
    score:1</p>
    
    <p>Vit<br>
    score:46</p>
    
    <p>Ala<br>
    score:20</p>
  </blockquote>
  
  <p>How can you sort by score?</p>