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."
"; } ?>