I want to send the username of the person submitting the form along with form data I wanted to know how to get the username for whoever submits a form so I can pass it to db_insert along with form data.

Sorry, I'm new to Drupal and php. I'm just try to learn.

Yes, it is custom code. Here is the form. I have based it on tutorials I've found so far.

function input_simple_form($form, &amp;$form_submit) {

$form['color'] = array(
    '#title' =&gt; t('color:'),
    '#type' =&gt; 'textfield',
    '#required' =&gt; TRUE,
            '#description' =&gt; t('What is your favorite color?'),
    '#prefix' =&gt; '&lt;div class="container-inline"&gt;', 
    '#suffix' =&gt; '&lt;/div&gt;&lt;br&gt;',
    );
$form['TV_Show'] = array(
    '#title' =&gt; t('TV_Show:'),
    '#type' =&gt; 'textfield',
    '#required' =&gt; TRUE,
    '#description' =&gt; t('What is favorite TV show?'),
    '#prefix' =&gt; '&lt;div class="container-inline"&gt;', 
    '#suffix' =&gt; '&lt;/div&gt;&lt;br&gt;',
    );

$form['input'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; 'Submit',
    '#submit' =&gt; array('input_simple_form_submit'),
    );

return $form;   
}


Then I send the data to database:

function input_simple_form_submit($form, &amp;$form_state) {

// Display a message upon successful submission.
drupal_set_message(t("Added @color @TV_Show", array('@color' =&gt; $form_state['values']['color'], '@Name' =&gt; $form_state['values']['TV_Show'])));
$id = db_insert("TestForm")
-&gt;fields(array(
    'color' =&gt; $form_state['values']['color'],      
    'TV_Show' =&gt; $form_state['values']['TV_Show'],
    'SubmitBy' =&gt; $user-&gt;name,
    ))
-&gt;execute();
}


I'm not sure how to pass $user to the submit function. Hope that helps.
You don't pass $user to the submit function.

Instead, you add a declaration of the global $user object to the start of the submit function to bring it into scope.  Like this:

function input_simple_form_submit($form, &amp;$form_state) {
  global $user;

  // Display a message upon successful submission.
  drupal_set_message(t("Added @color @TV_Show", array(
    '@color' =&gt; $form_state['values']['color'],
    '@Name' =&gt; $form_state['values']['TV_Show'],
  )));
  $id = db_insert("TestForm")
    -&gt;fields(array(
      'color' =&gt; $form_state['values']['color'],        
      'TV_Show' =&gt; $form_state['values']['TV_Show'],
      'SubmitBy' =&gt; $user-&gt;name,
    ))
    -&gt;execute();
}