Fix bind parameters mapping
This commit is contained in:
parent
3c0f023121
commit
090c86a62a
@ -266,10 +266,11 @@
|
|||||||
private function loadWithQuery($query, $bindParams = NULL) {
|
private function loadWithQuery($query, $bindParams = NULL) {
|
||||||
$stmt = self::$db->prepare($query);
|
$stmt = self::$db->prepare($query);
|
||||||
if (is_array($bindParams)) {
|
if (is_array($bindParams)) {
|
||||||
foreach ($bindParams as $key => &$value) {
|
$params = [];
|
||||||
$bindParams[$key] = $value;
|
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()) {
|
if ($stmt->execute()) {
|
||||||
$stmt->bind_result($this->id, $this->timestamp, $this->userId, $this->trackId,
|
$stmt->bind_result($this->id, $this->timestamp, $this->userId, $this->trackId,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user