views:

48

answers:

1

Hello Guys,

I'm very new to facebook and wanted to know if this is even possible to do with facebook API.

If a user searches for a name on my website - say "Jamie Smith" - I want to pass this name to facebook and find all users that match that name - so if I can get back their photo and name to display on my site - so users can identify the right person.

I'm using PHP so if there's any example or link that you can provide will be really helpful. Thanks

+1  A: 

You can use FQL to do this. Specifically, you can query the user table on name. Of course, you will only be able to see the public data for those users.

tloflin
Thanks tlofin - will look into that
Gublooo
tlofin - I tried this but it looks like uid is required for searching on the user table. Like if I search select name,pic from user where name = 'Jamie Smith' - I'm not getting back anything - but only if I provide uid - I'm getting results. In my case - I dont have uid's - all I have is a name - Thanks
Gublooo
@Gublooo, could you post the specific query you tried? This should be possible.
tloflin
This is my code - $fb = new Facebook('xyz', 'abc');$q = "SELECT name,pic FROM user WHERE name = 'Jamie'";$query = $fb->api_client->fql_query($q);
Gublooo
Sorry, it looks like Facebook coincidentally just made a major update or something, so I'm not sure exactly how this works now. I think you can use the [Graph API](http://developers.facebook.com/docs/api) for this now.
tloflin

related questions