function profile_save_profile

7.x profile.module profile_save_profile(&$edit, $account, $category, $register = FALSE)
6.x profile.module profile_save_profile(&$edit, &$user, $category, $register = FALSE)
1 call to profile_save_profile()
profile_user in drupal-6.x/modules/profile/profile.module
Implementation of hook_user().

File

drupal-6.x/modules/profile/profile.module, line 236
Support for configurable user profiles.

Code

function profile_save_profile(&$edit, &$user, $category, $register = FALSE) {
  $result = _profile_get_fields($category, $register);
  while ($field = db_fetch_object($result)) {
    if (_profile_field_serialize($field->type)) {
      $edit[$field->name] = serialize($edit[$field->name]);
    }
    db_query("DELETE FROM {profile_values} WHERE fid = %d AND uid = %d", $field->fid, $user->uid);
    db_query("INSERT INTO {profile_values} (fid, uid, value) VALUES (%d, %d, '%s')", $field->fid, $user->uid, $edit[$field->name]);
    // Mark field as handled (prevents saving to user->data).
    $edit[$field->name] = NULL;
  }
}