title: CREATE IDENTIFIER ----Insert 2 forms data into one table using php
body: <p>I have two forms : student.html and faculty.html and I want to store their data into one table called <code>TEACHING_AWARD_NOMINATIONS</code></p>
  
  <p>I use the same php file for both of them. Below is my code: </p>
  
  <pre><code>$srr = array_map('mysql_escape_string', $_REQUEST);
  
  if ($srr['NOMINATIONTYPE'] == 'STUDENT')
      $fields = Array('TYPE','NAME', 'EMAIL', 'NOMINEE', 'DEPT', 'COURSE', 'YEARTERM', 'REQUIRED_FOR_MAJOR', 'MAJOR_LEARNING_OBJECTIVES', 'WHAT_EXTENT_INSTRUCTOR_HELP', 'RANK', 'RANK_COMMENT','EVIDENCE','EFFECTION','CONTRIBUTION', 'TEXTBOX_1', 'TEXTBOX_2', 'TEXTBOX_3', 'TEXTBOX_4', 'TEXTBOX_5');
  else if ($srr['NOMINATIONTYPE'] == 'FACULTY')
      $fields = Array('TYPE','NAME', 'EMAIL', 'NOMINEE', 'DEPT', 'COURSE', 'YEARTERM', 'REQUIRED_FOR_MAJOR', 'MAJOR_LEARNING_OBJECTIVES', 'WHAT_EXTENT_INSTRUCTOR_HELP', 'RANK', 'RANK_COMMENT','EVIDENCE','EFFECTION','CONTRIBUTION', 'TEXTBOX_1', 'TEXTBOX_2', 'TEXTBOX_3', 'TEXTBOX_4', 'TEXTBOX_5');
  else die('error: no nomination type');
  
  
  foreach ($fields as $f)
      $$f = $srr[$f];
  
  $qry = "INSERT INTO TEACHING_AWARD_NOMINATIONS (";
      foreach ($fields as $f) $qry .= $f . ", ";
      $qry = substr($qry, 0, -2);
      $qry .= ") VALUES (";
      foreach ($fields as $f) $qry .= "'" . $$f . "', ";
      $qry = substr($qry, 0, -2);
      $qry .= ")";
  
  $result = mysql_query($qry) or die('An error ocurred: '.mysql_error());
  
  echo 'Success! Thank you for submitting your nomination.';
  </code></pre>
  
  <p>It stores the data perfectly except the <code>'TYPE'</code> column in the table </p>
  
  <p>below are the code in each html: </p>
  
  <pre><code>&lt;input type="hidden" name="NOMINATIONTYPE" value="FACULTY" /&gt;
              &lt;input type="submit" value="Submit" name="Submit" /&gt;
              &lt;input type="reset" value="Reset" name="Reset" /&gt;
  
  
  &lt;input type="hidden" name="NOMINATIONTYPE" value="STUDENT" /&gt;
              &lt;input type="submit" value="Submit" name="Submit" /&gt;
              &lt;input type="reset" value="Reset" name="Reset" /&gt;
  </code></pre>
  
  <p>How can I create a identifier for the table? I want the data submitted from student form shows type: student in the table and data submitted from faculty form shows type: faculty in the table .</p>
  
  <p>Please help ~~~</p>