'{$f_list}'
is only one value. But {$f_list}
is many column identifiers. The result is not enough values to be inserted (which mysql_error()
would tell you if you used it).
What you want is:
$result = mysql_query("INSERT into mytable(id, title, {$f_list})
VALUES ('$id','$title','{$val_list}')");
Basically you just used the wrong variable.