diff options
author | Simon Rettberg | 2017-04-27 13:46:42 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-04-27 13:46:42 +0200 |
commit | 8666590dd1184970bf8c93415e49f8f4be43ea5b (patch) | |
tree | e9c0f1ba79b3400e98c6249daf61f8f519105f29 /inc | |
parent | [locationinfo] Clean up translations (diff) | |
parent | Relax anti-caching headers a bit (diff) | |
download | slx-admin-8666590dd1184970bf8c93415e49f8f4be43ea5b.tar.gz slx-admin-8666590dd1184970bf8c93415e49f8f4be43ea5b.tar.xz slx-admin-8666590dd1184970bf8c93415e49f8f4be43ea5b.zip |
Merge branch 'master' into location-info-panel
Diffstat (limited to 'inc')
-rw-r--r-- | inc/database.inc.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/inc/database.inc.php b/inc/database.inc.php index f3a90fe7..9153c688 100644 --- a/inc/database.inc.php +++ b/inc/database.inc.php @@ -53,6 +53,20 @@ class Database return $res->fetch(PDO::FETCH_ASSOC); } + /** + * If you need all rows for a query as plain array you can use this. + * Don't use this if you want to do further processing of the data, to save some + * memory. + * + * @return array|bool List of associative arrays representing rows, or false on error + */ + public static function queryAll($query, $args = array(), $ignoreError = false) + { + $res = self::simpleQuery($query, $args, $ignoreError); + if ($res === false) + return false; + return $res->fetchAll(PDO::FETCH_ASSOC); + } /** * Execute the given query and return the number of rows affected. |