cch
cch

Reputation: 3386

Display Facebook image source by id

I am developing a Facebook application that stores into MySQL the photo[id]. I am using Facebook's Graph API to retrieve all of the user's photos and by a radio button the selected photo[id] is stored into mysql.

The problem is, how should I display the image's source by the id stored?

Upvotes: 6

Views: 10749

Answers (1)

phwd
phwd

Reputation: 19995

You inspect the Graph Object for that id,

graph.facebook.com/photoID

For example a photo from facebook.com/facebook

http://graph.facebook.com/427100966728

This will return a JSON response for which you can choose the size you desire for the source.

For more information see, http://developers.facebook.com/docs/reference/api/photo/

For example in the PHP SDK

$a_photo = $facebook->api('/427100966728');

<img src=<?php echo $a_photo['picture'] ?> />

Upvotes: 3

Related Questions