title: PHP Insert Statement to XAMPP MySQL Database Does Not Cause Table to Update
body: <p>
  I am attempting to write a program that will take information from an html form, and upload it to a MySQL database that exists on my local host(using XAMPP). To do this, I have used HTML to create a form that will take in the data to be inserted to the database, like this:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;link rel="stylesheet" href="styles/main.css"&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;title&gt;Presentation Registration&lt;/title&gt;
          &lt;script type="text/javascript"&gt;
          function Submit()
          {
              // I put input validation stuff here, but left it out to simplify code for reading
              document.getElementById("myForm").submit();
          }
      &lt;/script&gt;
  &lt;/head&gt; 
  
  &lt;body&gt;
      &lt;form id="myForm" action="actionPage.php" method="post"&gt;
      &lt;TABLE&gt;
          &lt;TR&gt;
              &lt;TD&gt;&lt;input type="radio" name="TimeSlot" class="TimeSlot" id="Slot1" value="Slot1"&gt;12/9/15, 6:00 PM – 7:00 PM&lt;/TD&gt;
              &lt;TD&gt;
              &lt;?php 
              $con = mysqli_connect('localhost','username','password', 'myDB');
  
              $query = "SELECT * FROM reserve";
  
              $result = mysqli_query($con, $query);
  
              $row = mysqli_fetch_array($result);
              echo $row["Open Seats"]." ";
              ?&gt;
              Seats Remaining&lt;/TD&gt;
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD&gt;&lt;input type="radio" name="TimeSlot" class="TimeSlot" id="Slot2" value="Slot2"&gt;12/9/15, 7:00 PM – 8:00 PM&lt;/TD&gt;
              &lt;TD&gt;&lt;?php
                  $row = mysqli_fetch_array($result);
                  echo $row["Open Seats"]." ";
                  ?&gt;
                  Seats Remaining&lt;/TD&gt;
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD&gt;&lt;input type="radio" name="TimeSlot" class="TimeSlot" id="Slot3" value="Slot3"&gt;12/9/15, 8:00 PM – 9:00 PM&lt;/TD&gt;
              &lt;TD&gt;&lt;?php
                  $row = mysqli_fetch_array($result);
                  echo $row["Open Seats"]." ";
                  ?&gt;
                  Seats Remaining&lt;/TD&gt;
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD&gt;&lt;input type="radio" name="TimeSlot" class="TimeSlot" id="Slot4" value="Slot4"&gt;12/10/15, 6:00 PM – 7:00 PM&lt;/TD&gt;
              &lt;TD&gt;&lt;?php
                  $row = mysqli_fetch_array($result);
                  echo $row["Open Seats"]." ";
                  ?&gt;
                  Seats Remaining&lt;/TD&gt;
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD&gt;&lt;input type="radio" name="TimeSlot" class="TimeSlot" id="Slot5" value="Slot5"&gt;12/10/15, 7:00 PM – 8:00 PM&lt;/TD&gt;
              &lt;TD&gt;&lt;?php
                  $row = mysqli_fetch_array($result);
                  echo $row["Open Seats"]." ";
                  ?&gt;
                  Seats Remaining&lt;/TD&gt;
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD&gt;&lt;input type="radio" name="TimeSlot" class="TimeSlot" id="Slot6" value="Slot6"&gt;12/10/15, 8:00 PM – 9:00 PM&lt;/TD&gt;
              &lt;TD&gt;&lt;?php
                  $row = mysqli_fetch_array($result);
                  echo $row["Open Seats"]." ";
                  ?&gt;
                  Seats Remaining&lt;/TD&gt;
          &lt;/TR&gt;
      &lt;/TABLE&gt;
      &lt;button type="button"&gt;Student List&lt;/button&gt;
      &lt;TABLE&gt;
          &lt;TR&gt;
              &lt;TD&gt;UMID&amp;nbsp&lt;/TD&gt;
              &lt;TD&gt;&lt;input type="text" class="inputText" id="UMID" name="UMID"&gt;&lt;/TD&gt;
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD&gt;First Name&amp;nbsp&lt;/TD&gt; 
              &lt;TD&gt;&lt;input type="text" class="inputText" id="fName" name="fName"&gt;&lt;/TD&gt;
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD&gt;Last Name&amp;nbsp&lt;/TD&gt;
              &lt;TD&gt;&lt;input type="text" class="inputText" id="lName" name="lName"&gt;&lt;/TD&gt;
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD&gt;Project Title&amp;nbsp&lt;/TD&gt;
              &lt;TD&gt;&lt;input type="text" class="inputText" id="projectTitle" name="projectTitle"&gt;&lt;/TD&gt;
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD&gt;E-Mail&amp;nbsp&lt;/TD&gt;
              &lt;TD&gt;&lt;input type="text" class="inputText" id="email" name="email"&gt;&lt;/TD&gt;  
          &lt;/TR&gt;
          &lt;TR&gt;
              &lt;TD&gt;Phone Number&amp;nbsp&lt;/TD&gt;
              &lt;TD&gt;&lt;input type="text" class="inputText" id="phone" name="phone"&gt;&lt;/TD&gt;
          &lt;/TR&gt;
      &lt;/TABLE&gt;
      &lt;button type="button" OnClick=Submit()&gt;Submit&lt;/button&gt;
      &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>As seen in the code, I use an action tag on the submit function to trigger "actionPage.php" to run. The code inside of that program is shown below:</p>
  
  <pre><code>&lt;?php
      $con = mysqli_connect('localhost','username','password', 'myDB');
      $umid = $_POST['UMID'];
      $fName = $_POST['fName'];
      $lName = $_POST['lName'];
      $projTitle = $_POST['projectTitle'];
      $eMail = $_POST['email'];
      $phone = $_POST['phone'];
      $slotID = "1";
  
  
      $query = "INSERT INTO student (UMID, fName, lName, projTitle, e-Mail, phone#, SlotID) VALUES ($umid, $fName, $lName, $projTitle, $eMail, $phone, $slotID)";
  
      $result = mysqli_query($con, $query);
  
      echo "Database Insertion Complete";
  ?&gt;
  </code></pre>
  
  <p>All of this connects to a database with two tables, student and reserve. When I run the code and input the information, actionPage.php triggers, and runs through all the code, including the echo statement at the end. However, the student table is not updated when I look in XAMPP. Is there something wrong with my code, or should I look for other issues?</p>