Code for Auto-updating a group of Facebook profiles

<?php
 
$app = new Facebook($api_key, $secret);
$app->api_client->session_key = $infinite_sessionkey;

 
$conn = mysql_connect($GLOBALS['db_ip'],
                                  $GLOBALS['db_user'],$GLOBALS['db_pass']);
 
mysql_select_db($GLOBALS['db_name'], $conn);

 
$res = mysql_query("SELECT userID FROM MyTABLE", $conn);
 
while ($row = mysql_fetch_assoc($res))

{
   try {
      // Set Profile FBML
      $profile = generateProfile($userID);
      $app->api_client->profile_setFBML($profile,$userID);
   } catch (Exception $e) {

   }
}
 
?>