diff --git a/helpers/position.php b/helpers/position.php index 69e004c..465466d 100644 --- a/helpers/position.php +++ b/helpers/position.php @@ -265,11 +265,11 @@ */ private function loadWithQuery($query, $bindParams = NULL) { $stmt = self::$db->prepare($query); - if (is_array($bindParams) && ($types = array_shift($bindParams))) { - call_user_func_array( - [ $stmt, 'bind_param' ], - array_merge([ $types ], array_map(function(&$param) { return $param; }, $bindParams)) - ); + if (is_array($bindParams)) { + foreach ($bindParams as $key => &$value) { + $bindParams[$key] = $value; + } + call_user_func_array([ $stmt, 'bind_param' ], $bindParams); } if ($stmt->execute()) { $stmt->bind_result($this->id, $this->timestamp, $this->userId, $this->trackId,