(This is called via PHP) I have the following:
"SELECT name FROM user WHERE uid IN (SELECT uid1 FROM friend WHERE uid2={$user})"
The SQL executes perfectly fine, however, the result is an array where the key is "name". I would like each result's key to be the respective uid in user that was searched to pull that name.
Example:
How it is right now
If the name was "Bob" and his uid was "12345", I would like the return array to be - [name] => Bob.
How I would like it to be
If the name was "Bob" and his uid was "12345", I would like the return array to be - [12345] => Bob.
EDIT (as per the comment request):
$fql = "SELECT pic FROM user WHERE uid IN (SELECT uid1 FROM friend WHERE uid2={$user})";
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$result = $facebook->api($param);