The WP Page is called Teams, and I have a table of data from my database. I want my Users to be able to sort via each column, but I don't think the 'sortby' values are being passed when the User clicks on the column header.
<table width="100%" class="first_impressions">
<tr>
<td width="21%"><b><a href="/teams?sortby=coachLast">Name</a></b></td>
<td width="23%"><b><a href="/teams/?sortby=school">High School</a></b></td>
<td width="13%"><b><a href="/teams/?sortby=sectional">Sectional</a></b></td>
<td width="8%"><b><a href="/teams/?sortby=class">Class</a></b></td>
<td width="35%"><b><a href="/teams/?sortby=email">Email</a></b></td>
</tr>
<tr>
<td>
<?php
if (!isset($_GET['sortby'])) {
$sortby = "sectional";
$query = 'SELECT * FROM hhr_schools ORDER BY '. $sortby .' ASC';
}
else {
$sortby = $_GET['sortby'];
$query = 'SELECT * FROM hhr_schools ORDER BY '. $sortby .' ASC, nameLast ASC';
}