MySQL从某个值开始

I have a mysql table with unique id's, and I'm displaying them in an html table. For those who are curious, here's the code.

<?php
require_once '../page.php';
require 'checklogin.php';

$page = new Page();
$page->title = 'View Students';
$page->sidebarliab = true;
$lastvari;

$id = $_GET['id'];
echo $id;

// Connect to database
$con = new mysqli($mysqlurl, $mysqlusername, $mysqlpassword, $mysqldatabase);

// Check connection
if (mysqli_connect_errno()) {
        echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

// Prepare to select all students

$stmt = $con->prepare("SELECT Last_Name, First_Name, Student_ID FROM Students LIMIT 30");
$stmt->execute(); // Execute the query
$stmt->bind_result($last_name, $first_name, $student_id); // Bind variables to the result of the query
?>

<h2 style='margin-left:1%'>All Students</h2>
<table id='liabilityTable'>
    <thead>
    <tr>
        <th>Last Name</th>
        <th>First Name</th>
        <th>Student ID</th>
        <th>Homeroom</th>
        <th>Number of Liabilities</th>
    </tr>
</thead>

<tbody>
    <?php
    while($stmt->fetch()) {
        echo "<tr>";
        ?>
        <td><?=$last_name?></td>
        <td><?=$first_name?></td>
        <td><?=$student_id?></td>
        <?php
        echo "<td></td>";
        echo "<td></td>";
        echo "</tr>";
            $lastvari = $student_id;
        }

    $stmt->close(); // Close the statement
        $con->close(); // Close connection to database
        ?>
    </tbody>
</table>

<a href=<?php echo "students_view.php?id=$lastvari"; ?>><button type="button">Next Page</button></a>

So basically, that's a table. I want to be able to click the top row and be able to organize it alphabetically (say clicking last name would organize by last name, clicking ID would be numerically, etc. just like in windows explorer). Does anybody know how I would be able to do this? Either a solution or just being pointed in the right direction would be absolutely fantastic.

Just make a links from that th's (for example: <th><a href="?order_by=last_name">Last name</a></th> ) Than add to your code big switch:

$order_by = '';
switch($_GET['order_by']){
   case 'last_name': // Value in your order_by A Href
      $order_by = 'Last_Name'; // Name of column in DB 
   break;
   .
   .
   .
   default:
     $order_by = 'your default value';
}

Then add to your query

 $stmt = $con->prepare("SELECT Last_Name, First_Name, Student_ID FROM Students ORDER BY " . $order_by . " ASC LIMIT 30");

Maybe you would think why just not skip that big switch and put the $_GET variable directly to SQL query? DON'T DO THAT!!! With that hacker or anyone would easily get access to your database...

Edited:
Below a few alternatives :)

jqtablekit: A simple tablesorter
tablesorter: Actually a plugin with various functionality, doesn't mention chrome support
gabriele: Also a simple tablesorter with a working demo