title: PHP, MYSQL, phpmyadmin - Using a html form to input records to a database
body: <p>My objective is to have two separate php pages.One page is for a user to input data into form fields (first name, last name, product, size), and the other is to display the updated table (after the user submits their fields).
  So far, I have created the two pages, with a functional form and a page that displays my tables results. Here is my code:</p>
  
  <p>Form.php</p>
  
  <pre><code>&lt;form action="process.php" method="post"&gt;
  &lt;p&gt;
  First Name:&lt;input type="text" name="first_name"&gt;&lt;br&gt;
  Last Name:&lt;input type="text" name="last_name"&gt;&lt;br&gt;
  Product:&lt;input type="text" name="product"&gt;&lt;br&gt;
  Size:&lt;input type="text" name="size"&gt;&lt;br&gt;
  &lt;/p&gt;
  &lt;input type="submit" name="submit"&gt;
  &lt;/form&gt;
  
  &lt;?php
  if (isset($POST['submit'])) {
      $con = mysql_connect("localhost","username","password");
  if (!$con){
  die("Connection was not successful:" . mysql_error());      
  }
  mysql_select_db("database_name",$con);
  
  $sql = "INSERT INTO Order_1 (First_Name, Last_Name, Product, Size) VALUES ('$_POST[first_name]','$_POST[last_name]','$_POST[product]','$_POST[size]')";
  
  
  $myData = mysql_query($sql,$con);
  
  mysql_close($con);
  }
  ?&gt;
  </code></pre>
  
  <p>And here is my results.php page, which displays my table:</p>
  
  <pre><code>&lt;?php   
  
  $con = mysql_connect("localhost","username","password");
  if (!$con){
  die("Connection was not successful:" . mysql_error());      
  }
  mysql_select_db("database name",$con);
  $sql = "SELECT * FROM Order_1";
  $myData = mysql_query($sql,$con);
  echo "&lt;table&gt;
  &lt;tr&gt;
  &lt;th&gt;First Name&lt;/th&gt;
  &lt;th&gt;Last Name&lt;/th&gt;
  &lt;th&gt;Product&lt;/th&gt;
  &lt;th&gt;Size&lt;/th&gt;
  &lt;/tr&gt;";
  
  while($record = mysql_fetch_array($myData)){
  echo "&lt;tr&gt;";
  echo "&lt;td&gt;" . $record['First Name'] . "&lt;/td&gt;"; 
  echo "&lt;td&gt;" . $record['Last Name'] . "&lt;/td&gt;";
  echo "&lt;td&gt;" . $record['Product'] . "&lt;/td&gt;";
  echo "&lt;td&gt;" . $record['Size'] . "&lt;/td&gt;";
  echo "&lt;/tr&gt;";
  }
  echo"&lt;/table&gt;";
  mysql_close($con);
  
  ?&gt;
  </code></pre>
  
  <p>I currently have two records in my table, that I manually typed into phpmyadmin. When i fill out this form, and click submit, it takes me to the "process.php" but nothing has changed. It's still only displaying the two records I have. And inside my PHPmyAdmin, it only has those two records. So my form isn't working how i'd like -- inputting a record submitted from the form, from a user, and displaying the entire table, included the record just recorded from the user, on the "process.php" code.
  I have gone over my code for (oh my god its been 4 hours now) and I can't find the solution. I've tested numerous things. Can anyone help? It'd be much appreciated.</p>