I’m new in PDO
$sFields = "'".implode("', '", $fields)."'";
$sColumns = implode(", ", $columns);
$sql = "INSERT INTO $table ($sColumns) VALUES ($sFields)";
What is the shortest way to use PDO::quote on each value I want to insert.
I tried
$fields = array_map('$bdd->quote', $fields);
but it returns:
Warning: array_map() expects parameter 1 to be a valid callback, function ‘$bdd->quote’ not found or invalid function name
There is other way than concat sql string.