As I've found several ways to create array and insert it into the mysql query, I made a code below which obviously doesn't work. I pay attention on brackets and commas, but I missed something around VALUES.
Because, that is the part that is not working, the first part of the query (columns) is written properly (I think) but I got stuck with the second implode.
Please help.
$f_ids = array(f1, f2, f3, f4, f5);
$f_list = implode(',', $f_ids);
$val_ids = array($val[1],$val[2],$val[3],$val[4],$val[5]);
$val_list = implode("','", $val_ids);
$result = mysql_query("INSERT into mytable(id, title, {$val_list})
VALUES ('$id','$title','{$f_list}')");
Where is the error, I cannot find it???
$f_listin the values, is that intentional?