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.
<input style="margin-left:28px;" type="image" class="add_field_button" src="img/add.png" />
<table id="dataTable" width="900" style="margin-left:25px; margin-top:10px;">
<tr style="text-align:center;">
<td width="70">From</td>
<td>To</td>
<td>Duration Hours</td>
<td>Code</td>
<td>Remark</td>
</tr>
<tr style="height:85px; text-align:center;">
<td><input type="text" name="hours1[]" id="hours1" /></td>
<td><input type="text" name="hours2[]" id="hours2" /></td>
<td><input type="text" name="durationh[]" id="durationh" /></td>
<td><input type="text" name="hrscode[]" id="hrscode" /></td>
<td><textarea name="remark[]" id="remark"></textarea></td>
</tr>
</table>
Inputs are expandable so I don't know how many rows they will send to save in mysql
.