The example shows this to generate the needed number of question marks, which is amazingly wasteful:
$place_holders = implode(',', array_fill(0, count($params), '?'));
Instead, just do:
$place_holders = '?'.str_repeat(',?', count($params)-1);
The example shows this to generate the needed number of question marks, which is amazingly wasteful:
$place_holders = implode(',', array_fill(0, count($params), '?'));
Instead, just do:
$place_holders = '?'.str_repeat(',?', count($params)-1);