Question

FB.api(
{
method: 'fql.query',
query: 'select uid,name from user where uid in (select uid2 from friend where uid1 ='+me.id+') AND current_location='+me.location.name
},function(data) { alert(data);

}

iam trying to get the friends based on the current user location.But this query is not working? Is there any possible way to write this as a single query? I need to loop all the datas to check the current location else ,but it takes time for checking it.So iam looking for single query to get the datas? Could any one help me with it?

Was it helpful?

Solution

This is just an idea, firstly your application requires user_location and friends_location as permissions.

Why don't you modify your query to something like this

FB.api(
{
   method: 'fql.query',
   query: 'select uid,name,current_location from user where uid in (select uid2 from friend where uid1 ='+me.id+')
   },function(data) { alert(data);
}

The idea is to get current_location of user and user's friends and then do your filtering.

Hope this helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top