I have an array of Information States And Totals. I want to see how to get the Total of all the Totals for each state.
I know I have to use a loop but I am not sure which - what would I do?
This is what I have so far. It's making the array from a database.
$WorkFind = mysql_query(
"SELECT Customers.State, WorkOrders.Total
FROM WorkOrders
INNER JOIN Customers
ON WorkOrders.CID=Customers.ID
WHERE WorkOrders.Type <> 'Warranty'
AND (WorkOrders.Status <> 'Closed'
OR WorkOrders.Status <> 'Cancelled')
AND WorkOrders.TransferID='0'
ORDER BY Customers.State ASC");
while ($Work = mysql_fetch_array($WorkFind)) {
}
The while loop has made the array but I'm unsure what to put into it.
I'm using PHP 5.3 and MYSQL 5.2