diff options
Diffstat (limited to 'inc/database.inc.php')
-rw-r--r-- | inc/database.inc.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/inc/database.inc.php b/inc/database.inc.php index 082b13b6..3b2414b5 100644 --- a/inc/database.inc.php +++ b/inc/database.inc.php @@ -77,6 +77,19 @@ class Database } /** + * Fetch the first column of the query as a plain list-of-values array. + * + * @return array|bool List of values representing first column of query + */ + public static function queryColumnArray($query, $args = array(), $ignoreError = null) + { + $res = self::simpleQuery($query, $args, $ignoreError); + if ($res === false) + return false; + return $res->fetchAll(PDO::FETCH_COLUMN, 0); + } + + /** * Execute the given query and return the number of rows affected. * Mostly useful for UPDATEs or INSERTs * @@ -132,7 +145,7 @@ class Database if (!isset(self::$statements[$query])) { self::$statements[$query] = self::$dbh->prepare($query); } else { - self::$statements[$query]->closeCursor(); + //self::$statements[$query]->closeCursor(); } $start = microtime(true); if (self::$statements[$query]->execute($args) === false) { |