From 090c86a62a13c4935797a12f18d0d1b854cfe68e Mon Sep 17 00:00:00 2001 From: Bartek Fabiszewski Date: Tue, 23 May 2017 10:01:21 +0200 Subject: [PATCH] Fix bind parameters mapping --- helpers/position.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/helpers/position.php b/helpers/position.php index 465466d..9f4009d 100644 --- a/helpers/position.php +++ b/helpers/position.php @@ -266,10 +266,11 @@ private function loadWithQuery($query, $bindParams = NULL) { $stmt = self::$db->prepare($query); if (is_array($bindParams)) { - foreach ($bindParams as $key => &$value) { - $bindParams[$key] = $value; + $params = []; + foreach ($bindParams as &$value) { + $params[] =& $value; } - call_user_func_array([ $stmt, 'bind_param' ], $bindParams); + call_user_func_array([ $stmt, 'bind_param' ], $params); } if ($stmt->execute()) { $stmt->bind_result($this->id, $this->timestamp, $this->userId, $this->trackId,