I am very new to this and am looking for some help. I am replicating a report in my current system with the following code.
<?php
foreach ($possibleSanctionsAssociativeArray as $currentSanction => $currentSanctionDetailsArray)
{
$tableHeadersArray = array ('Home Office',' Total');
$query = "SELECT home_office, COUNT(file_id) FROM cases WHERE ".$currentSanction."='Yes' and ($refdate>='$begindate' AND $refdate<='$enddate') GROUP BY home_office";
$title = "<p class='report_title'> <b>".getSanctionDescriptiveName($currentSanction)."</b>";
simpleStatTable($query, $tableHeadersArray, $title);
}
?>
It displays a Table with two columns and two rows:
HOME OFFICE | Total
OJA | 82
ORL | 634
I would like it to display a third row that says “OVERALL TOTAL | 716”
I have tried several solutions with no luck, I think I am struggling with the sum of a count field, then displaying the count.
Thanks for all the help in advance.
I misunderstood the question at first. This should work: