title: How to get Number of male and female friends and what is their percentage facebook apps
body: <pre><code>$query = 'SELECT friend_count FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) and sex='male'';
  
  $url = "https://graph.facebook.com/fql?q=" . urlencode($query) . 
       "&amp;access_token=" . $access_token;
  $data = json_decode( file_get_contents ($url));
  $boys = count($data[data]);
  echo $boys;
  </code></pre>
  
  <p>i have tried this method but unable to get the desired result...
  I want to make an app like this</p>
  
  <p><img src="https://i.stack.imgur.com/1nyca.jpg" alt=""></p>