I'm trying to get the latitude/longitude of all of a user's friends using a single API call. I believe I need to write a multi-query FQL statement, but I can't get the syntax correct.

I believe the two queries need to be something like the following:

'"friends":"SELECT uid,current_location FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())"'

'"location":"SELECT location FROM page WHERE id IN (SELECT current_location_id FROM #friends)"';


My problem is that somehow I need to get the ID of the current_location in the first query so that I can reference it in the second query, but I only know how to get an array that contains the id.

Thanks for any help!

Clarification:

I'm not trying to get check-ins of friends.  Instead I want to graph the "current_location" (i.e. where they live) of all of a user's friends on a Geo map.  I can get a user's "current_location" with the following FQL query:

"SELECT uid,sex,current_location FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())"


This query returns the following array:

[current_location] =&gt; Array
            (
                [city] =&gt; New York
                [state] =&gt; New York
                [country] =&gt; United States
                [zip] =&gt; 
                [id] =&gt; 108424279189115
                [name] =&gt; New York, New York
            )


Which does not contain the longitude and latitude of the of the current_location (New York in the above example)

Therefore I now need to take the ID of the current_location (e.g. 108424279189115) and run a second FQL query such as:

"SELECT location,name FROM page WHERE page_id = 108424279189115)"


To get the latitude and longitude of the current_location.  Currently, I have a working code that runs the first FQL query, then extracts page_id in php, and then runs a second FQL query to get the current_location latitude/longitude.  However, for performance reasons I would like to run only one multi-query if this is possible.


Question: Making a C++ app scriptable
Answer: Does your system have to "take a string"?  You could expose COM (or CORBA, or whatever) interfaces on your application and have whatever is generating these commands call into your application directly.