I was inserting multiple arrays into my database using this code:
$queries_cols = array();
for($i=0; $i<count($cols); $i++)
{
$queries_cols [] = "('".$cols[$i]."','".$int_manha1_1[$i]."','".$int_manha1_2[$i]."','" .$int_tarde2_1[$i]."','".$int_tarde2_2[$i]."','".$h1_1[$i].$h1_2[$i]."','".$h2_1[$i].$h2_2[$i]."')" ;
}
$query_col = "INSERT into cols_ponto_diaria values '".implode(",", $queries_cols)."'";
$result = mysql_query($query_col) or die("Erro: ".mysql_error());
And when I submit the form it output an error:
Erro: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''('Ricardo','08:30:00','12:15:00','14:45:00','18:00:00','0115','1215')'' at line 1
Can anyone find where is the error? I've tried a few solutions but without any success.
Thanks in advance.