How To Use PHP, MySQL and Dynamic XML to display Dynamic table in HTML

Hi,
I am quite new in programming and have a question. I need to be able to connect to a MYSQL database (which I did), parse the data into an array table and then modify the data to be displayed in an HTML table by using dynamic XML structure as the data in MySQL database changes. The data looks some thing like this:

Company_Name Evaluator_Name Metric_Name Metric
A Bob A 1
B Jason B 3
C Richard C 5
D Carl D 2
A Bob D 1
B Jason C 3
C Richard B 5
D Carl A 2

I need to change the structure of the above so that the Names of the Evaluators appear as the Headings when displayed on the page. It should look something like this:

Company_Name Metric_Name Bob Jason Richard Carl
A A 1 0 0 2
B B 0 3 5 0
C C 0 3 5 0
D D 1 0 0 2

Basically I need to rebuild my original query so that the names appear on the top and the Metric associated with the names of the Evaluators appear under them so that I can compare the Evaluators’ marks which they have assigned to the metric.

I am trying to use PHP with MySQL and Dynamic XML(don’t know if I need it)

Please help and give me some advice.