How can I insert this array to database using loop?
Array (
[0] => 1
[1] => 0
[2] => 0
)
I try like this way:
$chimp= Array (
[0] => 1
[1] => 0
[2] => 0
)
foreach ($reponse as $value) {
$values= mysql_real_escape_string($value);
foreach ($chimp as $valuech ) {
$valuesch= mysql_real_escape_string($valuech);
$query = mysql_query("INSERT INTO reponses (nom_reponse,id_question,id_categorie,correct2) VALUES ('$values','$last_id','$categorie','$valuesch')")
or die(mysql_error());
}
}
I need the steps to insert $reponse
and $chimp
data in each row?