two days and have had no success with what I am trying to code, so ANY
assistance would be appreciated. Thank you.
I have to Tables in a MySQL Database.
One is called weekly ; it holds information per employee.
Code: Select all
weeklyId, employeeID, departmentID, reportingPeriod, hoursWorked, hoursOut, vacationHours
1 - 1 - 1 - unixtimestamp - 40 - 10 - 25
2 - 2 - 1 - unixtimestamp - 40 - 10 - 25
3 - 4 - 2 - unixtimestamp - 12- 35 - 15
4 - 3 - 3 - unixtimestamp - 14 - 95 - 0Code: Select all
departmentID, departmentName
1 - Womens Underwear
2 - Sports Equipment
3 - Kitchenware
4 - ToysThat is easy enough, just pull everything from the database, and as I loop it add it all
together.
I can find grand totals for each individual . . . even easier.
Yet, here is where I can not figure out any logic, listing each Department once, and Subtotals
for each one . . . I am at a complete and total loss as to the logic. I have tried putting into an
array and sorting it out properly, I have tried mildly comlpex SQL queries, with no avail . . .
For Example:
Code: Select all
Womens Underwear: 80 - 20 - 50
Sports Equipment: 12- 35 - 15If I need to post anything else, please just say so . . .
Thank you thank you thank you.
-mr atomika