save the value of a custom form in the database Why isn't the code saving values in the database?

module_load_include('inc', 'firstform', 'firstform_node_form_alter');

function firstform_menu() {
$items = array();

$items['submit_driven_ajax'] = array(
    'title' =&gt; 'send your email',
    'page callback' =&gt; 'drupal_get_form',
    'access callback' =&gt; TRUE,
    'weight' =&gt; 3,
);
return $items;


}

function firstform_intro() {
$markup = t('The AJAX example module provides many examples of AJAX including forms, links, and AJAX commands.');
return $markup;}

function firstform_form($form, &amp;$form_state) {
$form['box'] = array(
    '#type' =&gt; 'markup',
    '#prefix' =&gt; '&lt;div id="box"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;',
);
$form['email'] = array(
    '#type' =&gt; 'textfield',
    '#required' =&gt; TRUE
    , '#description' =&gt; "Please enter your email name.",
    '#ajax' =&gt; array(
        'callback' =&gt; 'firstform_text_driven_callback',
        'wrapper' =&gt; 'box',
        'name' =&gt; 'email1',
    ),
);
$form['submit'] = array(
    '#type' =&gt; 'submit',
    '#ajax' =&gt; array(
        'callback' =&gt; 'firstform_submit_driven_callback',
        'wrapper' =&gt; 'box',
        'name' =&gt; 'submit1',
    ),
    '#value' =&gt; t('Submit'),
);

return $form;}

function firstform_submit_driven_callback($form, $form_state) {
$element = $form['box'];
$element['#markup'] = "your email ({$form_state['values']['email']}): " . date('c');
return $element;}

function firstform_text_driven_callback($form, $form_state) {
$element = $form['box'];
$element['#markup'] = "your email ({$form_state['values']['email']}): " .date('c');
return $element;}

 function firstform_block_info() {
$blocks = array();
$blocks['firstform'] = array(
    'info' =&gt; t('Form mail'),
    'weight' =&gt; 0,
);
return $blocks;}

function firstform_block_view($delta = '') {
module_load_include('inc', 'node', 'node.pages');
switch ($delta) {
    case 'firstform':
        $block['subject'] = t('');
        $form = drupal_render(node_add('firstform'));
        $block['content'] = $form;

        break;
}
return $block;}



  function firstform_node_insert($node){
  db_insert('firstform_node_form_alter')
-&gt;fields(array(
  'nid' =&gt; $node-&gt;nid,
  'email' =&gt; $node-&gt;firstform['email'],
  'date' =&gt; $node-&gt;firstform['date'],
))
-&gt;execute();}

function firstform_node_update($node) {


 if (db_select('firstform_node_form_alter', 'a')-&gt;fields('a')-&gt;condition('nid', $node-&gt;nid, '=')-&gt;execute()-&gt;fetchAssoc()) {
db_update('firstform_node_form_alter')
  -&gt;fields(array(
    'email' =&gt; $node-&gt;firstform['email'],
    'date' =&gt; $node-&gt;firstform['date'],
  ))
  -&gt;condition('nid', $node-&gt;nid)
  -&gt;execute();
  }  else {
firstform_node_insert($node);}}

    function firstform_node_delete($node) {  db_delete('firstform_node_form_alter')
-&gt;condition('nid', $node-&gt;nid)
-&gt;execute();}


When I add firstform.install, the firstform_node_form_alter table is not created.

function firstform_schema() {
 $schema['firstform_node_form_alter'] = array(
'description' =&gt; 'Stores email settings for nodes.',
'fields' =&gt; array(
  'nid' =&gt; array(
    'type' =&gt; 'int',
    'unsigned' =&gt; TRUE,
    'not null' =&gt; TRUE,
    'default' =&gt; 0,
    'description' =&gt; 'The {node}.nid to store settings.',
  ),'email' =&gt; array(
    'type' =&gt; 'varchar',
    'not null' =&gt; TRUE,
    'default' =&gt; 0,
    'description' =&gt; 'Node Form Example 1 textfield',
  ),
  'date' =&gt; array(
    'type' =&gt; 'int',
    'length' =&gt; 256,
    'not null' =&gt; FALSE,
    'default' =&gt; '',
    'description' =&gt; 'Node Form date textfield',
  ),
),
'primary key' =&gt; array('nid'),
'foreign keys' =&gt; array(
  'dnv_node' =&gt; array(
    'table' =&gt; 'node',
    'columns' =&gt; array('nid' =&gt; 'nid'),
  ),
),
 );
return $schema;
}
hook_schema is called at install and unistall, so make sure your actually installing the module and not just turning it on.

If you've already had your module running on your site, switched it off at /admin/modules and then switched it back on, drupal doesn't recognize this as an uninstall/install event. Rather, you need to fully remove it from the DB by going to admin/modules/uninstall after switching the module off.