how do i get total values in a row by grouping into diffrent categories.
here is my code bt its getting oll totals in a row for now..
<?php require_once('connect.php'); ?>
<?php
$query="Select Amountspent from Moneyout";
$result=mysql_query($query);
$total=0;
while($row=mysql_fetch_array($result))
{
$total=$total + $row['Amountspent'];
}
echo "Total is:" . $total;
?>
the colums are, Amountspent,Category,Financialyear and Financialmonth...i want it to group by the Amountspent,Category,Financialyear and Financialmonth..
please help