essence: in the form of 5 lines (maybe not 5), in each of them there are 2 fields (let's call a group), each group belongs to a specific line in the database (in the database has id and these 2 fields). the groups themselves in html are output in a loop, id is assigned to each group (belonging to lines in the database), when I submit a form, I get all the fields in a row, I need to understand how to group them before sending, or the laconic way to work with a bunch of data
$ a:
Array ( [0] => Array ( [ID] => 1 [forms_email] => 525, 123 [form_id] => 1 [form_name] => form_comp [active] => N ) [1] => Array ( [ID] => 38 [forms_email] => 532523 [form_id] => 2 [form_name] => TESTED [active] => N ) [2] => Array ( [ID] => 44 [forms_email] => [form_id] => 6 [form_name] => 5566 [active] => N ) ) the form:
<?for($i=0;$i<count($a);$i++){?> <tr> <td><?=$a[$i]["form_name"]?></td> <td><input type="text" value="<?=$a[$i]["forms_email"]?>" name="field<?=$a[$i]['ID']?>"> <input type="checkbox" name="check<?=$a[$i]["ID"]?>"> Активен?</td> <input type="hidden" name="id<?=$a[$i]["ID"]?>" value="id<?=$a[$i]["ID"]?>"> </tr> <?}?> what comes in the post:
[field1] => 525, 123 [check1] => on [id1] => id1 [field38] => 532523 [check38] => on [id38] => id38 [field44] => [id44] => id44 the question is how best to put this data in the table in the database (given that checkbox if not selected does not come). field and check - fields in the table, id - for identification
