title: HTML Form wont create new entries
body: <p>I am trying to create a basic form fill, where you can add a season or new entries and that will post to a databse and I can't seem to figure it out for the life of me. When I run it what I get is that the new seasons "Add more Episodes" buttons dont work and that the title for seasons are in the wrong place. </p>
  
  <pre><code>&lt;?php
  if ($_SERVER['REQUEST_METHOD'] === 'POST') {
      // create a variable
      $title=$_POST['Title'];
      $seasonNum=$_POST['SeasonNum'];
  
  
      //Execute the query
      $connect = mysqli_connect('localhost','root','123','mydatabase');
      $sql = "INSERT INTO $title(SeasonNum) $SeasonNum(myInputs[])";
      mysqli_query($connect, $sql);
  
      if(!$connect) {
          die 'Failed to connect because ' . mysqli_connect_errno();
      }
  }
  
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;span id="responce"&gt;&lt;/span&gt;
  &lt;h2&gt;Season 1&lt;/h2&gt;
  &lt;form method="post" action=""&gt;
  &lt;div id="dynamicInput"&gt;
        Entry 1&lt;br&gt;&lt;input type="text" name="myInputs[]"&gt;
  &lt;/div&gt;
   &lt;br&gt;
  &lt;input type="button" value="Add Another Episode"onClick="addInput('dynamicInput');"&gt;
  
  &lt;input type="button" value="Add Another Season" onClick="addSeason('dynamicSeason');"&gt;
  
  &lt;div id= "dynamicSeason"&gt;
  
  &lt;/div&gt;
  
  &lt;input type="submit" value="Add Show"&gt;
  &lt;/form&gt;
  &lt;script src="script.js" charset="utf-8"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>JavaScript file (script.js)</p>
  
  <pre><code>var counter = 1;
   var limit = 3;
   var EpisodeAdd = 2;
   x=1;
   function addInput(divName){
  
         var newdiv = document.createElement('div');
         newdiv.innerHTML = "Entry " + (counter + 1) + "&lt;br&gt;&lt;input type='text' name='myInputs[]'&gt;";
         document.getElementById(divName).appendChild(newdiv);
         counter++;
  
   }
  
   function addSeason(divName){
         i=1;
         x++;
         var h1 = document.createElement("h1");
       var h1Text = document.createTextNode("Season " + x);
       h1.appendChild(h1Text);
       document.body.appendChild(h1)
         while(i&gt;0){
           var newdiv = document.createElement('div');
           newdiv.innerHTML = "h1Text Entry " + (counter + 1) + " &lt;br&gt;&lt;input type='text' name='myInputs[]'&gt;&lt;br&gt;&lt;input type='button' value='Add Another Episode' onClick='addInput('Dynamic'EpisodeAdd);'&gt;";
           document.getElementById(divName).appendChild(newdiv);
           i--;
           EpisodeAdd++;
         }
         counter++;
  
  
   }
  </code></pre>