db_update with a hook Have a field called url_time in the users table.
I have this function in place, though it does not update the table on the else part.

Does this code look correct?

function my_module_form_submit($form,$form_state)
{
global $user;
$account = user_load($user-&gt;uid);
$op = $form_state['values']['op'];

if ($op == $form['linkedin']['reset']['#value']) {
    if (db_field_exists('users', 'url_time')) {
        db_update('users')
            -&gt;condition('uid', $account-&gt;uid)
            -&gt;expression('url_time', 0)
            -&gt;execute();
    }
}
else {
    $date = time();
    if (db_field_exists('users', 'url_time')) {
        db_update('users')
            -&gt;condition('uid', $account-&gt;uid)
            -&gt;expression('url_time', $date)
            -&gt;execute();
    }
}
}


This is the linkedin function that I am trying to implement, so when the user authorities, the "else" will write a date.

function linkedin_user_enable_form($form, $form_state, $uid) {
$form = array();
$form['#user'] = $uid;
$form['#action'] = url('linkedin/token/' . $uid);
$form['submit'] = array(
 '#type' =&gt; 'submit',
 '#value' =&gt; t('Go to LinkedIn'),
'#suffix' =&gt; '&lt;p class="description"&gt;' . t('You will be taken to the LinkedIn website in order to complete the process.') . '&lt;/p&gt;',
);
return $form;
}
This wouldn't delete just the field, it would delete the row for a user whose uid equals $account-&gt;uid. The -&gt;expression() and subsequent -&gt;execute() as @kiamlaluno points out, wouldn't work right anyway.

If you want to simply delete the value, you are better off doing something like this:

// $account is defined up ^^ there somewhere.
$account-&gt;url_time = '';
user_save($account);