i have prepared form api, now how to insert form values when i click submit button by using db_insert I have prepared a form using Drupal form API. Now how can I insert the form values when I click the submit button by using db_insert()?

$form['totp'] = array(
    '#title' =&gt; t('Title of the Programme'),
    '#type' =&gt; 'textfield',
    '#required' =&gt; TRUE,
    '#maxlength' =&gt; 250, 
    '#size' =&gt; 50,    
);

$form['pd'] = array(
    '#type' =&gt; 'radios',
    '#title' =&gt; t('Programme Day'),
    '#required' =&gt; TRUE,
    '#options' =&gt; array(
        0 =&gt; 'One Day Programme',
        1 =&gt; 'Two or More Day Programmes'
    ),
);


The above values to be stored in MySQL table?
You would need to add a custom form submit handler.

$form['#submit'][] = 'mymodule_custom_form_submit';


Then, in the function, use $form_state['values'];

function mymodule_custom_form_submit($form, $form_state){
    db_insert('yourtable')
        -&gt;fields(array(
            'totp' =&gt; $form_state['values']['totp'], 
            'pd' =&gt; $form_state['values']['pd']
          ))
        -&gt;execute();    
}