Hi friends,
I am trying to user nested foreach to insert data into table with three different column fields. Please look at that because i am getting error [syntax error, unexpected ',', expecting ')'].
$cLists = $_POST['nd'];
$Votes = $_POST['text'];
$Votes_p = $_POST['text1'];
$id = $_POST['invst_id'];
//foreach($cLists as $nomineeid)
foreach (array_combine($cLists, $Votes, $Votes_p) as $nomineeid => $voted, $p_vote){
//foreach ($Votes_p as $voted_p => $p_vote) {
$query = "INSERT INTO election (invst_id_ar , nomine_id, vote_gain, vote_gain_p, casted_d_t) VALUES ('$id', '$nomineeid', '$voted', '$p_vote', NOW())";
}
}
--
Kind Regards
Have a G(::)D DaY!