As an example, let's say I have three form text inputs all with the name item[]. Each of these inputs have a value consisting of two numbers separated by a comma.
<input type="text" name="item[]" value="8,6" />
<input type="text" name="item[]" value="6,1" />
<input type="text" name="item[]" value="9,4" />
The first number in the value field relates to an id in a mysql database table. The second is a value that will update another field.
I have used:
foreach($_POST['item'] as $items){
echo $items. "<br/>";
}
This displays the values like so:
8,6
6,1
9,4
I would now like to take these values and insert into a table with data fetched with the first value (the id value).
What would be the best way to go about accomplishing this?