How to show new added filed to comment table in comment form page I am writing a module which is adding a new filed to comment table, and in the comment form I want a new filed to be displayed, saying: : " Which paragraph you want to put comment on?".

I have already added the new filed to comment table, I just do not know  what hook should I use, so this new filed will be also shown on comment form.
First, you need to make sure Drupal knows about your paragraph field. Adding it to the database alone won't work. Use hook_schema_alter() to alter the DB schema information for the comment table. Do this by adding something like the below to your module's install file (a PHP file you name mymodule.install in your module's folder):

function MYMODULE_schema_alter(&amp;$schema) {
    $schema['comment']['fields']['paragraph'] = array(
        'type' =&gt; 'int',
        'not null' =&gt; FALSE,
        'default' =&gt; 0,
        'description' =&gt; 'Paragraph of the comment.',
    );
}


Be sure to flush your caches to update the schema.

Now you need to alter the comment form, and process the paragraph value. Something like the below should work:

function MYMODULE_form_comment_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    $form['paragraph'] = array(
        '#type' =&gt; 'textfield',
        '#title' =&gt; t('Which paragraph you want to put comment on?'),
        '#required' =&gt; FALSE,
        '#size' =&gt; 10,
        '#maxlength' =&gt; 2,
        '#default_value' =&gt; !empty($form['#entity']-&gt;paragraph) ? $form['#entity']-&gt;paragraph : NULL, // set the default value to the current paragraph value
        '#weight' =&gt; $form['subject']['#weight'] + 1, // place after the subject field by setting the weight to +1 of subject weight
    );

    $form['#validate'][] = 'MYMODULE_form_comment_form_validate';
    $form['#submit'][] = 'MYMODULE_form_comment_form_submit';
}

function MYMODULE_form_comment_form_validate(&amp;$form, &amp;$form_state) {
    if (!is_numeric($form_state['values']['paragraph'])) {
        // Validate the paragraph value to make sure it is numeric. Non-numeric values will break because we created paragraph as an integer field
        form_set_error('paragraph', t('Only numeric values are allowed for paragraph number.'));
    }
}

function MYMODULE_form_comment_form_submit(&amp;$form, &amp;$form_state) {
    // update the paragraph field in the comment table
    db_update('comment')
    -&gt;fields(
        array(
            'paragraph' =&gt; $form_state['values']['paragraph'],
        )
    )
    -&gt;condition('cid', $form_state['comment']-&gt;cid)
    -&gt;execute();
}