diff options
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/database.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engine/lib/database.php b/engine/lib/database.php index 01767be39..5989f55c3 100644 --- a/engine/lib/database.php +++ b/engine/lib/database.php @@ -303,7 +303,7 @@ * @return object A single database result object
*/
- function get_data_row($query) {
+ function get_data_row($query, $callback = "") {
global $CONFIG, $DB_QUERY_CACHE; @@ -329,6 +329,10 @@ if ((isset($CONFIG->debug)) && ($CONFIG->debug==true)) error_log("$query results cached"); $DB_QUERY_CACHE[$query] = $row; + + if (!empty($callback) && is_callable($callback)) { + $row = $callback($row); + } if ($row) return $row;
} |