diff options
-rw-r--r-- | App/database/Select.php | 9 | ||||
-rw-r--r-- | App/database/dbSetup.php | 7 | ||||
-rw-r--r-- | Helper.php | 3 |
3 files changed, 12 insertions, 7 deletions
diff --git a/App/database/Select.php b/App/database/Select.php index ba3a62a..a8ddb35 100644 --- a/App/database/Select.php +++ b/App/database/Select.php @@ -93,7 +93,7 @@ class Select extends dbSetup { $query = "SELECT task_with_status.id as id, title, description, user, level, stamp, task_with_status.style_class as style_class, status_level.id as level_id FROM `task_with_status` LEFT JOIN status_level ON task_with_status.level=status_level.plain_text"; $param = ""; - $secondParam = &$taskID; + $secondParam = $taskID; if (count($taskID) > 0) { $query .= " WHERE status_level.id IN("; for ($i = 0; $i < count($taskID); $i++) { @@ -106,13 +106,12 @@ class Select extends dbSetup $query .= ")"; } - array_push($secondParam, $param); - $secondParam = array_reverse($secondParam); + array_unshift($secondParam, $param); $stmt = $this->getDb()->prepare($query); - call_user_func_array(array($stmt, "bind_param"), $secondParam); + var_dump($secondParam); + call_user_func_array(array($stmt, "bind_param"), $this->makeValuesReferenced($secondParam)); $stmt->execute(); $res = $stmt->get_result(); - $a = array(); while($row = $res->fetch_object()){ $a[] = $row; diff --git a/App/database/dbSetup.php b/App/database/dbSetup.php index 7c5e118..4bf183d 100644 --- a/App/database/dbSetup.php +++ b/App/database/dbSetup.php @@ -36,4 +36,11 @@ class dbSetup { return $this->db; } + protected function makeValuesReferenced(&$arr) + { + $refs = array(); + foreach($arr as $key => $value) + $refs[$key] = &$arr[$key]; + return $refs; + } } @@ -34,5 +34,4 @@ function isLoggedIn(){ return false; } } - -}
\ No newline at end of file +} |