Write form value to database I need to save this to database, but could not find a way to make it work.
Now this paypal_email is only saved to current user. Apparently it is saved somehow to the database under user table, but it can not be read there? Or use views to read it.


function commerce_funds_manage_withdrawal_method_paypal($form, &amp;$form_state) {

  $enabled_methods = variable_get('commerce_funds_withdrawal_methods', array());

  if (!$enabled_methods['paypal'])
    return FALSE;

  global $user;

  $form['paypal_email'] = array(
      '#type' =&gt; 'textfield',
      '#title' =&gt; t('Paypal Email'),
      '#description' =&gt; t('Withdrawals using Paypal will be sent to this email'),
      '#default_value' =&gt; $user-&gt;data &amp;&amp; array_key_exists('paypal', $user-&gt;data) ? $user-&gt;data['paypal']['paypal_email'] : '',
      '#size' =&gt; 40,
      '#maxlength' =&gt; 64,
      '#required' =&gt; TRUE,
  );

  $form['submit'] = array(
      '#type' =&gt; 'submit',
      '#value' =&gt; t('Save'),
  );

  return $form;
}

function commerce_funds_manage_withdrawal_method_paypal_submit($form, &amp;$form_state) {

  global $user;

  user_save($user, array('data' =&gt; array('paypal' =&gt; $form_state['values'])));
}
I don't think the $user->data value can be read by views.  You are probably better off creating a field to store the email value.