I want insert multiple names and pay values from one form and table using checkbox.
The main idea is get some unpaid receipt results from 1 mysql query and insert the pay receipts on mysql.
<form name"teste" method="post" action="">
<table width="200" border="1">
<tbody>
<tr>
<td>
<input type="text" name="name[]" id="name"></td>
<td><input name="pay[]" type="checkbox" value="1" id="valor"></td>
</tr>
<tr>
<td>
<input type="text" name="name[]" id="name"></td>
<td><input name="pay[]" type="checkbox" value="1"></td>
</tr>
<tr>
<td>
<input type="text" name="name[]" id="name"></td>
<td><input name="pay[]"type="checkbox" value="1"></td>
</tr>
<tr>
<td>
<input type="text" name="name[]" id="name"></td>
<td><input name= "pay[]" type="checkbox" value="1"></td>
</tr>
</tbody>
</table>
<p>
<input type="submit" name="submit" id="submit" value="Enviar">
</p>
</form>
<?php
if(isset($_POST['name'])){
$name[]=($_POST['name']);
$pay[]=($_POST['pay']);
$arr=array(array($name), array($pay)
);
//$value=array($_POST['pay']);
echo'<pre>';
print_r($arr);
echo'</pre>';
foreach($arr as $key=>$p){
// I want echo $name " pay = " $pay
// I´m lost I cant foun solution
}
?>