Thanks Orodreth,
Got a working AJAX / PHP page which orders and sorts beautifully, using a combination of your code and
this tutorial on IBM site.
I won't post the whole code but here's the description of the main table
Code:
<table id="data_table" width="100%" cellpadding=3 cellspacing=3>
<tr>
<th onclick="orderBy('populate_table.php', 'col_name=name', 'data_body')">name</th>
<th onclick="orderBy('populate_table.php', 'col_name=score', 'data_body')">score</th>
<th onclick="orderBy('populate_table.php', 'col_name=rank', 'data_body')">rank</th>
<th onclick="orderBy('populate_table.php', 'col_name=company', 'data_body')">company</th>
</tr>
<tbody id="data_body">
</table>
I'll describe the process because it might be useful for newbies like me:
This HTML page contains the above table def, and a javascript function orderBy(URL, arg, destination) which determines whether to sort
ASC or DESC, then does a GET request which is picked up by populate_table.php. That runs an SQL statement on a MySQL view, and populates the table and the resulting html comes back to this HTML file and becomes the table body, data_body.
The only problem remaining problem is I need to display data, (ordered by name ascending) when the page first loads. How do I do this without the user having to click?
I also have to consider browsers with javascript disabled, who will not be able to sort. These should display data_table ordered by name ascending so can I kill two birds with one stone here?
Thanks for all the advice - pretty easy when someone points you in the right direction!

matt