I have read a great deal and trying to learn how to get data into a table in the db. I have the below code to test entering just the first name of someone and I am getting an error. I have tried to follow the examples.module but I am missing something. I would appreciate a nudge in the right direction...
function ghost_form_form_submit($form, &$form_state) {
$entity_id = db_insert('field_data_field_first_name') // database table name
->fields(array(
'field_first_name_value' => $form_state['values']['field_first_name_value'],
))
->execute();
drupal_set_message(t('Your form entry has been added'));
}
Here is the complete form code... https://gist.github.com/anonymous/f6d8dc19a3eed0f56d59
The only error I get in watchdog is the $entity_id. However I am not sure what I am missing. Thanks
node_save()
,field_attach_submit()
, etc)