A particularly helpful adaptation of this function and the call_user_func_array function:
// $params is sent as array($val=>'i', $val=>'d', etc...)
function db_stmt_bind_params($stmt, $params)
{
$funcArg[] = $stmt;
foreach($params as $val=>$type)
{
$funcArg['type'] .= $type;
$funcArg[] = $val;
}
return call_user_func_array('mysqli_stmt_bind_param', $funcArgs);
}
Thanks to 'sned' for the code.