i have prepared form api, now how to insert form values when i click submit button by using db_insert
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();    
}