title: Insert Dynamic PHP form into MySQL
body: <p>I have a form which is dynamic and user can add more rows to insert different hours, I wonder which is the best way to add those data to MySQL database.</p>
  
  <pre><code>&lt;input style="margin-left:28px;" type="image" class="add_field_button" src="img/add.png" /&gt;
  &lt;table id="dataTable" width="900" style="margin-left:25px; margin-top:10px;"&gt;
      &lt;tr style="text-align:center;"&gt;
          &lt;td width="70"&gt;From&lt;/td&gt;
          &lt;td&gt;To&lt;/td&gt;
          &lt;td&gt;Duration Hours&lt;/td&gt;
          &lt;td&gt;Code&lt;/td&gt;
          &lt;td&gt;Remark&lt;/td&gt;
      &lt;/tr&gt; 
      &lt;tr style="height:85px; text-align:center;"&gt;
          &lt;td&gt;&lt;input type="text" name="hours1[]" id="hours1" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="hours2[]" id="hours2" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="durationh[]" id="durationh" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="hrscode[]" id="hrscode" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;textarea name="remark[]" id="remark"&gt;&lt;/textarea&gt;&lt;/td&gt;
  
      &lt;/tr&gt; 
  &lt;/table&gt;
  </code></pre>
  
  <p>Inputs are expandable so I don't know how many rows they will send to save in <code>mysql</code>.</p>