diff options
author | root | 2019-02-19 18:53:50 +0100 |
---|---|---|
committer | root | 2019-02-19 18:53:50 +0100 |
commit | 0ad4c0f8196b61699754762aacbaab0223478ab9 (patch) | |
tree | de434c4aea8d07ecd01cd3badd48d057d62c2d1b /inc/database.inc.php | |
parent | [usb-lock-off] Edit rule cleanup and fix of the dropdown boxes. (diff) | |
parent | [statistics] Fix RAM change warning to handle increase too (diff) | |
download | slx-admin-0ad4c0f8196b61699754762aacbaab0223478ab9.tar.gz slx-admin-0ad4c0f8196b61699754762aacbaab0223478ab9.tar.xz slx-admin-0ad4c0f8196b61699754762aacbaab0223478ab9.zip |
Merge branch 'master' into usb-lock-offusb-lock-off
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) { |