I have the following (a bit sloppy)code:
$query = "SELECT uid2 FROM friend WHERE uid1=me()";
$results = $facebook->api(array( 'method' => 'fql.query', 'query' => $query));
foreach ($results as $key=>$value) { // we need 2 foreach cause we have arrays within an array, or put another way, an array of arrays.
foreach ($value as $key2=>$value2) {
echo $value2;
echo ',';
}
}
echo $me['id'];This results in: 622366942,640611878,658477005,1069795465
Just like this topic author, I want to use this in a variable to use in a sql select. How to do that?
The SELECT will look something like:
select $variable from etcetcThanks,
ps I've echoed the , into it to get the result of $value2 separated by comma's. Is there a better way to do this and how? Also at the end I've added $me['id']; this is correct, it ads my own ID in the result