Alright then. Since I seem to be doing more work on this than you do, I'll pass you this code and leave it at that. You can adapt it from now on to suit your own needs.
There's all kinds of ways you could do it. I just realized the most obvious way as I was about to paste a much larger snippet. Oh well, :sighs: mental gymnastics are good for us! Naturally, you could remove each instance of "\t\t\t\t" - you could also un-indent the other html tags too. I just prefer nice indentation (although it does make the page a little larger - for no benefit unless you view-source)
Any-who..
<!DOCTYPE html>
<html>
<head>
<style>
tr.sortStuff th:hover{background-color: rgb(200,200,200);}
tr.addStuff th:hover{background-color: rgb(200,255,200);}
</style>
<script>
</script>
</head>
<body>
<table>
<thead>
<tr class='addStuff'>
<th colspan='7'>Add Book | Add Author</th>
</tr>
<tr class='sortStuff'>
<th><a href='<?php echo $_SERVER["PHP_SELF"]?>?order=title'>Title</th>
<th><a href='<?php echo $_SERVER["PHP_SELF"]?>?order=author'>Author Name</th>
<th><a href='<?php echo $_SERVER["PHP_SELF"]?>?order=genre'>Genre</th>
<th><a href='<?php echo $_SERVER["PHP_SELF"]?>?order=country'>Country</th>
</tr>
</thead>
<tbody>
= $_GET[= "SELECT * FROM authors a, books b, publish p where p.authorid=a.authorid and p.bookid=b.bookid"= " ORDER BY $sortField ASC"= mysqli_query($con,= mysqli_fetch_array($result))
";
echo "\t\t\t\t<td>" . $row['title'] . "</td>";
echo "\t\t\t\t<td>" . $row['fname'] . "</td>";
echo "\t\t\t\t<td>" . $row['genre'] . "</td>";
echo "\t\t\t\t<td>" . $row['country'] . "</td>";
echo "\t\t\t\t</tr>";
}
mysqli_close($con);
*/
?> </tbody>
</table>
</body>
</html>