hi,
in my web page i want look like this.
A B C D E F G H i j k l m n o p q r s t u v w x y z show all
that means alphabetic sort when i click on "a" then only select that topic which are start with "a". and also want how to display above string (A - Z). and fetching data from data base table.
pls reply.
Thanks.
sorting alphabatically
Moderator: General Moderators
Re: sorting alphabatically
This is called "paging". Search for it both on these boards & Google.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: sorting alphabatically
Code: Select all
<a href="urpage.com/script.php?sort=a">a</a>
<a href="urpage.com/script.php?sort=b">b</a>
Code: Select all
$selector = mysql_real_escape_string(trim(strip_tags($_GET['sort'])));
$query = "SELECT topicTitle
FROM topicTable
WHERE TopicTitle LIKE '".$selector."%'";
$result = mysql_fetch_row($query) or print(mysql_error());
while($row = mysql_fetch_row($result))
{
/* list topics here */
echo $row[0]."<br />";
}