How to insert multiple arrays with a foreach in rows of databases?
It's not a problem with an array, but my problem is to use two arrays or more.
my php code:
$checkBox1 = implode(',', $_POST['goinput1']);
$checkBox2 = implode(',', $_POST['goinput3']);
$mark3=explode(',', $checkBox1);
$mark4=explode(',', $checkBox2);
foreach($mark3 as $out3)
{
$sql_sub = "INSERT INTO sub_forms
(bord_mizban,bord_mihman)
VALUES ('$out3','$out4')";
if ($conn->query($sql_sub) === TRUE) {
} else {
}
}
** I want the out 4 variable insert to the database with the out 3 variable **