Just pass a $_GET variable through the URL and have it say:
?s=WO (for work order #)
?s=requestor (for requestor)
etc., etc.
Then just make you're query dynamic by:
SELECT .... ORDER BY $_GET['s'] ASC
Obviously, if your table headings are not wo, requestor and the like, you'll need to modify the $_GET['s'] before adding it to your SQL query.
<?php
$columns = Array('wo' => 'id',
'requestor' => 'Requestor_Name',
'date' => 'Date_Submitted',
'location' => 'Campus, Building, Room',
'problem' => 'Problem',
'summary' => 'Summary',
'status' => 'Status');
// Define the mySQL column heads associated with the $_GET['s'] values
// "s_value" => "mySQL_column_name"
if(!isset($_GET['s']) || empty($_GET['s']))
{
$_GET['s'] == 'wo';
}
$query = "SELECT * FROM '.$workordertable.' ORDER BY '.$columns[$_GET['s']].' ASC";
// Do whatever else here
?>
<th class="clean">Edit</th>
<th><a href="?s=wo">W.O.#</a></th>
<th><a href="?s=requestor">Requestor</a></th>
<th><a href="?s=date">Date Submitted</a></th>
<th><a href="?s=location">Location</a></th>
<th><a href="?s=problem">Problem Type</a></th>
<th><a href="?s=summary">Summary</a></th>
<th><a href="?s=status">Status</a></th>
<?php
// More php code....
?>
~Brett