Skip to content

Commit

Permalink
Testing print data
Browse files Browse the repository at this point in the history
  • Loading branch information
mtcnxd committed Jan 17, 2025
1 parent a3679d8 commit 08ccb29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion classes/bills.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
3 changes: 1 addition & 2 deletions wallet.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@
<?php
$data = $bills->spendsByCategory(date('Y-m-01'), date('Y-m-t'));
foreach ($data as $value) {
echo "<p>".$value->category."</p>";
echo "<p>".$value->amount."</p>";
echo "<p>".$value->category."<b>".$value->amount."</b></p>";
}
?>
</div>
Expand Down

0 comments on commit 08ccb29

Please sign in to comment.