I can add an extra field to the registration. What I need to know is what step do I need to take to then grab that input and insert it into the user table of drupal. The code below is in my module this adds just a field to the form, but when its submitted it doesnt do anything with the data.
function perscriptions_user($op, &$edit, &$account, $category = NULL){
if ($op == 'register') {
$form['surgery_address'] = array (
'#type' => 'textarea',
'#title' => t('Surgery Address'),
'#required' => TRUE,
);
return $form;
}
if ($op == 'update') {
// …
}
}
As reported in hook_user() documentation:
The module needs to create its own database table in
hook_install().hook_user()could be implemented with the following code, for example:prescriptions_save_user_profile()is the function that saves the user profile values in the database. The code checks the category to avoid to show the same form fields in all the tabs shown in the user profile edit form.