Here are two options to consider:
1. You can use $_GET['choice'] to get the sorting value, then pass that to your SQL statement.
ex. (assuming you have good filtering on $_GET):
$sort = $_GET['choice'];
$result = mysqli_query($con,"SELECT * FROM authors a, books b, publish p where p.authorid=a.authorid and p.bookid=b.bookid ORDER BY $sort");
I would recommend moving your HTML output to a separate file and using AJAX to run your query and create the table, but if you have to have it all in one file, this should still work.
2. If you can use JavaScript, use a script to sort your table. I use jQuery in my projects, and have found the
Tablesorter jQuery plugin[
^] to be very helpful for these kinds of tables.
Good luck!