Without seeing any existing code, I'll give an example. For an alphabetic listing of books make a php page called books_alpha.php, then, make your links something like....
<a href="books_alpha.php?by=A">A</a>
Then... on books_alpha.php
<?php
// connect to db.
if (isset($_GET['by'])) {
$sort = $_GET['by'];
$result = mysql_query("SELECT name FROM books WHERE name LIKE '$sort%'");
if ($result) {
while ($row = mysql_fetch_assoc($result)) {
echo $row['name']."<br />"
}
}
}
?>
A pretty simplified example, but hopefully you'll get the idea. You could just as easily create all this on one page, and just pass what yoiu want to sort by through the url aswell. eg; list.php?sort=books&letter=A