From b43ad07abe75eb743732f50f264ed177d1f32477 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 7 Jul 2019 15:42:19 +0100 Subject: [PATCH] typo --- core/database.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/core/database.php b/core/database.php index 27763c51..7bfd365a 100644 --- a/core/database.php +++ b/core/database.php @@ -265,11 +265,7 @@ class Database public function get_col(string $query, array $args=[]): array { $_start = microtime(true); - $stmt = $this->execute($query, $args); - $res = []; - foreach ($stmt as $row) { - $res[] = $row[0]; - } + $res = $this->execute($query, $args)->fetchAll(PDO::FETCH_COLUMN); $this->count_time("get_col", $_start, $query, $args); return $res; } @@ -293,11 +289,7 @@ class Database public function get_pairs(string $query, array $args=[]): array { $_start = microtime(true); - $stmt = $this->execute($query, $args); - $res = []; - foreach ($stmt as $row) { - $res[$row[0]] = $row[1]; - } + $res = $this->execute($query, $args)->fetchAll(PDO::FETCH_KEY_PAIR); $this->count_time("get_pairs", $_start, $query, $args); return $res; }