mysql - How to add a colon to front of each string in array php pdo -
i writing pdo loop create number of mysql statement. pdo formating requires colon in front of column names.
before:
(cryptokeys, domains, records)
after:
(:cryptokeys, :domains, :records)
what php function can use put colon in front of each element in foreach loop?
you can loop through array , add :
foreach ($array &$value) $value = ':'.$value;
also array_walk can used well
array_walk($array, function(&$value) { $value = ':'.$value; });
Comments
Post a Comment