current i'm doing this FQL to get user info
Please help me combing all the query into one [i want to get all the info in 4 arrays by writing a single FQL] !
$pics=array();
$ids=array();
$names=array();
$sexs=array();
$i=0;
$fql = "SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) ";
$fUIDS = $facebook->api(array(
'method' => 'fql.query',
'query' =>$fql,
));
foreach($fUIDS as $data)
{
$ids[$i]=$data['uid'];
$i++;
}
?>
<?php
$fql = "SELECT name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) ";
$fNames = $facebook->api(array(
'method' => 'fql.query',
'query' =>$fql,
));
$i=0;
foreach($fNames as $data)
{
$names[$i]=$data['name'];
$i++;
}
$fql = "SELECT pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) ";
$fPics = $facebook->api(array(
'method' => 'fql.query',
'query' =>$fql,
));
$i=0;
foreach($fPics as $data)
{
$pics[$i]=$data['pic_square'];
$i++;
}
$fql = "SELECT sex FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())";
$fSexs = $facebook->api(array(
'method' => 'fql.query',
'query' =>$fql,
));
$i=0;
foreach($fSexs as $data)
{
$sexs[$i]=$data['sex'];
$i++;
}
?>