I have created a specific function for bridging Icy Phoenix with any other software and being able to keep track of user data changed (such as email and password).
The function is in class_users.php:
* User profile update: this function is called when username, email and password are changed in a user profile
global $db, $config, $user, $lang;
$target_profile_data = array(
'user_id' => '',
'username' => '',
'password' => '',
'email' => ''
The work is still incomplete, because I should have coded a hook where customized files could be hooked, but didn't do that so far... anyway the function is still a great helper, since it is connected to any crucial data change in a user profile.
Regarding your issue, try to print the var just to make sure that the var has been properly "globalized".
Try to add this somewhere
Alternatively pass the DB throug a $_POST var.