update profile photo(API)

Posted by newprog on Stack Overflow See other posts from Stack Overflow or by newprog
Published on 2010-06-09T10:56:36Z Indexed on 2010/06/09 11:02 UTC
Read the original article Hit count: 225

Filed under:

I want to update users profile photo.

require_once('facebook.php');


$facebook = new Facebook('..', '..');
$facebook->require_frame();
$user = $facebook->require_login();

//At first I get it
$fql = "SELECT pic FROM User WHERE uid=\"$user\"";

//this get profile url
$fql_result = $facebook->api_client->fql_query($fql);
//here
// get photo and change it 

$new_image = "***.jpg";//changed photo

$fql = "UPDATE User SET pic=\"$new_image\" WHERE uid=\"$user\"";

$fql_result = $facebook->api_client->fql_query($fql);

Are these steps correct.

Thank`s for help

© Stack Overflow or respective owner

Related posts about php