//get all id\'s of ur friend that has installed your application $friend_pics=$facebook->api( array( \'method\' => \'fql.query\', \'query\' => \"SELECT uid FRO
$friend_pics should be a string containing a comma separated list i.e. "1, 2, 3, 4". If it is not, then your second query will always fail.
$friend_pics