title: Php insert to mysql variable values from inputs
body: <p>How to add to mysql e.g. 4 fields and another time e.g. 120 fields? I mean I got script who create inputs, and I want to add that to mysql, but in mysql I can only add as many values ​​as I set.</p>
  
  <p>There example : <code>id</code>,<code>name</code>,<code>1</code>,<code>2</code>,<code>3</code> but I want that these values ​​are not limited in 1 record.</p>
  
  <p>And example  : set <code>id</code>,<code>name</code>,<code>1</code>,<code>2</code>,<code>3</code>,<code>...</code>,<code>2000</code> in my script who create inputs.</p>
  
  <pre><code>&lt;form method="POST" action="api.php"&gt;
    &lt;input type="text" name="name[]" class="admininput"&gt;
    &lt;input type="text" name="image[]" class="admininput"&gt;
    &lt;input type="hidden" name="movie[]" value="0" class="admininput"&gt;
    &lt;input type="text" name="seasioncount[]" class="admininput"&gt; 
    &lt;div class="inputs"&gt;
      &lt;input type="text" name="sectioncount[]" class="admininput"&gt;        
      &lt;button class="add_form_field"&gt;Add New Field &amp;nbsp; &lt;span style="font-size:16px; font-weight:bold;"&gt;+ &lt;/span&gt;&lt;/button&gt;
    &lt;/div&gt;
    &lt;input type="submit" name="submit" class="button" value="submit"/&gt;
  &lt;/form&gt;
  &lt;script&gt;
  $(document).ready(function() {
      var max_fields      = 1000;
      var wrapper         = $(".inputs"); 
      var add_button      = $(".add_form_field"); 
  
      var x = 1; 
      $(add_button).click(function(e){ 
          e.preventDefault();
          if(x &lt; max_fields){ 
              x++; 
              $(wrapper).append('&lt;div&gt;&lt;input type="text" name="serial[]" class="admininput""/&gt;&lt;a href="#" class="delete"&gt;Delete&lt;/a&gt;&lt;/div&gt;'); //add input box
          }
          else
          {
          alert('You Reached the limits')
          }
      });
  
      $(wrapper).on("click",".delete", function(e){ 
          e.preventDefault(); $(this).parent('div').remove(); x--;
      })
  });
  &lt;/script&gt;
  </code></pre>