From 08ccb2986b288a9f8bd00457456d7c46363b14c4 Mon Sep 17 00:00:00 2001 From: Marcos Tzuc Date: Fri, 17 Jan 2025 12:33:46 -0600 Subject: [PATCH] Testing print data --- classes/bills.php | 2 +- wallet.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/classes/bills.php b/classes/bills.php index ec53f77..d3a5275 100644 --- a/classes/bills.php +++ b/classes/bills.php @@ -46,7 +46,7 @@ public function getDataBetween($type, $startDate, $endDate) public function spendsByCategory($startDate, $endDate) { $mysql = new QueryBuilder(); - $query = "SELECT category, sum(amount) FROM wallet_bills where date between '$startDate' and '$endDate' group by category"; + $query = "SELECT category, sum(amount) AS amount FROM wallet_bills where date between '$startDate' and '$endDate' group by category"; return $mysql->get($query); } } diff --git a/wallet.php b/wallet.php index c89d25c..538e770 100644 --- a/wallet.php +++ b/wallet.php @@ -177,8 +177,7 @@ spendsByCategory(date('Y-m-01'), date('Y-m-t')); foreach ($data as $value) { - echo "

".$value->category."

"; - echo "

".$value->amount."

"; + echo "

".$value->category."".$value->amount."

"; } ?>