easy code
visit page Sorting column by clicking column header using php and mysql
It should be helpful for make a table with sortable column using php and mysql
<?php include('header.php'); ?> <html> <body> <div class="row-fluid"> <div class="span12"> <div class="container"> <br> <br> <label>Order by:</label> <a class="btn" href="ascending.php">Ascending</a> <a class="btn" href="decending.php">Decending</a> <br> <br> <table class="table table-striped table-bordered"> <thead> <tr> <th>FirstName</th> <th>LastName</th> <th>MiddleName</th> <th>Address</th> <th>Email</th> </tr> </thead> <tbody> <?php $id=$row['member_id']; ?> <tr> <td><?php echo $row['firstname'] ?></td> <td><?php echo $row['lastname'] ?></td> <td><?php echo $row['middlename'] ?></td> <td><?php echo $row['address'] ?></td> <td><?php echo $row['email'] ?></td> </tr> <?php } ?> </tbody> </table> </form> </div> </div> </div> </div> </body> </html>
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.