Submit data into database 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, &amp;$form_state) {
$entity_id = db_insert('field_data_field_first_name') // database table name
  -&gt;fields(array(
    'field_first_name_value' =&gt; $form_state['values']['field_first_name_value'],
  )) 
  -&gt;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
This message is probably because you missed some database fields in your insert query (we do not know the field type and what exactly you are trying to achieve). Other than that, it is very odd that you attempt to insert a record directly in a Drupal field's table as this not how it is meant to be used. As per Clive's comment, this can lead to data inconsistencies, cache issues etc.

So I would strongly recommend you to take a good look at Drupal examples on how to define a custom table using Schema API, or even better take a look at this guide on using the Entity API, which you allow you to properly utilize Drupal Fields with your own custom module. Third option is to use the API of an existing module such as nodes, users etc. so that you properly save the field's value.