title: Inserting data from Multiple forms into multiple tables with MySQL
body: <p>I have multiple forms that I am trying to insert data from into MySql.  Each form has a different table associated with that information.  I am using an insert.php file to insert the data.  The first form works great.  However when I add any other variables to the initial file it errors out. This is my insert file:</p>
  
  <pre><code>&lt;?php # NAME OF PROGRAM GOES HERE
  
  require_once 'config.php'; 
  
  // Get values from form
  $Fname        = $_POST['first_name'];
  $email        = $_POST['email']; 
  
  // Insert data into mysql
  $sql="INSERT INTO entry (first_name, email)
  VALUES ('$Fname', '$email')";
  $result = mysql_query($sql);
  
  // if successfully insert data into database, displays message "Successful".
  if($result){
  echo "Successful Entry";
  }
  else {
  echo "ERROR";
  }
  mysql_close();
  ?&gt; 
  </code></pre>
  
  <p>This is the first form:</p>
  
  <pre><code>&lt;form action="insert.php" method="post" name="admin" onSubmit="return validateForm()"&gt;
  &lt;p&gt;Please enter First Name &lt;input type="text" name="first_name" required="required"/&gt;
  &lt;p&gt;Please enter your Email&lt;input type="text" name="email" required="required" &gt;&lt;br /&gt;
  &lt;input type="submit" name="submit" value="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The second form is:</p>
  
  <pre><code>&lt;form action="insert.php" method="post" onSubmit="return validateForm()"&gt;
  &lt;p&gt;Favorite Winery Name &lt;input type="text" name="fav_winery" /&gt; &lt;br /&gt;
  &lt;p&gt;Favorite White Wine&lt;input type="type" name="fav_white" /&gt; &lt;br /&gt;
  &lt;p&gt;Favorite Red Wine &lt;input type="type" name="fav_red" /&gt; &lt;br /&gt;&lt;br /&gt;
  &lt;input type="submit" name="submit" value="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>How do I INSERT the information from the second form into another table already created?</p>