let me start off with the fact that i'm still kind of new to php/mysql.
I'm trying to build a system that can be used to record jobs completed for customers that keeps track of job numbers, customer name, equipment, dates, and employee's assigned to the task.
I have a table setup to handle the employee's assigned, but I can't seem to figure out how to format the results the way I would like.
There could be multiple employee's assigned to the same job over several days. So I setup a table like:
job_ID | employee_name | date_worked | hours_worked
1 | Dave | 2010-1-2 | 4.5
1 | Dave | 2010-1-3 | 4.0
1 | Mike | 2010-1-2 | 6.0
2 | Bill | 2011-5-7 | 8.0
2 | Bill | 2011-5-8 | 6.5
2 | Dave | 2011-5-7 | 4.0
2 | Dave | 2011-5-8 | 4.5
What i'm looking to do with the results is output it like:
Job # = 1
Employee | 2010-1-2 | 2010-1-3 |
Dave | 4.5 | 4.0 |
Mike | 6.0 | 0 |
Job # = 2
Employee | 2011-5-7 | 2011-5-8 |
Bill | 8.0 | 6.5 |
Dave | 4.0 | 4.5 |
Can anyone offer advice?
EDIT
Ok, so I guess I left out some information.
I have a table (job_list) that is used to keep records.
This table records the job_id, client, equipment, location, call date, response date, completion date, etc.
Then I have a table (employee_list) that lists all employees by id, and name.
The idea behind the table I posted earlier was to be the table that just records who was where, on what day, and for how long.
I've amended the table i posted to have employee_id.
And I would like to display the results in php to look like the output i posted. I just don't know how to do it.
What other information can I provide? Apologies for my lack of understanding on what I need to post :-/
And if my approach is completely horrible, I did say I'm still new to this...