update profile photo(API)
- by newprog
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