D7 update field in database problem function sms_user_delete($uid, $number = FALSE) {
  userfieldmobil_user_update($account->uid); // my custom field about users i call this manually. 
  $query = db_delete('sms_user')
    ->condition('uid', $uid);
  if ($number) {
    $query->condition('number', $number);
  }
  $num_deleted = $query->execute();
}

function userfieldmobil_user_update($uid) { // i make it manually not able to update this
$num_updated = db_update('field_data_field_mobilnumber')
->fields(array(
'field_mobilnumber_value' => '',
))
->condition('entity_id', $uid, '>=')
->execute();
}


What i'm doing wrong sms_user delete OK but my custom field has value but not updated.
If you want to update your field when user was deleted you should put your update query into your sms_user_delete. Because userfieldmobil_user_update will only works if u update user data, not delete it.

function sms_user_delete($uid, $number = FALSE) {
  userfieldmobil_user_update($account-&gt;uid); // my custom field about users i call this manually. 
  $query = db_delete('sms_user')
    -&gt;condition('uid', $uid);
  if ($number) {
    $query-&gt;condition('number', $number);
  }
  $num_deleted = $query-&gt;execute();

  $num_updated = db_update('field_data_field_mobilnumber')
     -&gt;fields(array(
     'field_mobilnumber_value' =&gt; '',
     ))
     -&gt;condition('entity_id', $uid, '&gt;=')
     -&gt;execute();
  }


Its not like in drupal 6 where u can use hook_user, read about hook_user_update and hook_user_delete for more info.