I'm new to programming and I have a project where I'm stuck. I have a form where I have the option to add more lines when needed (clone the line). Here is the form:
<form method="post" action="values.php">
<table>
<tr>
<th>Code</th>
<th>Description</th>
<th>Quantity</th>
<th>Price</th>
</tr>
<tr class="clone">
<td><input type="text" name="cod[]" id="cod" class='input' /></td>
<td><input type="text" name="desc[]" id="desc" class='inputp'/></td>
<td><input type="text" name="qt[]" id="qt" class='input' /></td>
<td><input type="text" name="price[]" id="price" class='input' /></td>
</tr>
</table>
<p>
<a href="#" class="add" rel=".clone">Add Line</a>
</p>
<input type="submit" value=" Submit " />
</form>
when I submit this form it gives me multiple arrays, so here they are.
Array
(
[cod] => Array
(
[0] => 10
[1] => 12
)
[desc] => Array
(
[0] => description for the code 10
[1] => description for the code 12
)
[qt] => Array
(
[0] => 1
[1] => 20
)
[price] => Array
(
[0] => 100.00
[1] => 200.00
)
)
How do I insert this data it into mysql? This is my first post so sorry if I wrote anything wrong.