From d671bb3288a83fa5b94406118aa97e781d46283c Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Thu, 24 Feb 2022 15:29:50 -0500 Subject: [PATCH] Fix Database::fetch_array --- public/main/inc/lib/database.lib.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/public/main/inc/lib/database.lib.php b/public/main/inc/lib/database.lib.php index ff0cb59683..cc8ab14b2e 100644 --- a/public/main/inc/lib/database.lib.php +++ b/public/main/inc/lib/database.lib.php @@ -218,14 +218,13 @@ class Database return []; } - $i = 0; + $return = $data; foreach ($data as $value) { - $data[$i] = $value; - $i++; + $return[] = $value; } - return $data; + return $return; } /** @@ -297,7 +296,13 @@ class Database if ($resource->rowCount() > 0) { $result = $resource->fetchAllAssociative(); - return $result[$row][$field]; + $resultRow = $result[$row]; + + foreach ($result[$row] as $value) { + $resultRow[] = $value; + } + + return $resultRow; } return false;