Hello Guys,

I am having the database table with say 100 records.
I want to display the records sorted by title field.
How I want to display the records is that

A

All the titles starting from A
----
-----

B

All the titles starting from B
----
-----

and so on

I am having array as
PHP Code:
$alpha_array=array("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");
$i=0;
while(
$row=@mysql_fetch_array($result))
{
$title=$row['title'];
//Here i want to match the first character of $title with $alpha_array[$i]
//if matches then display the alphabet and then records that start with that //alphabet
$id=$row['id'];
$i++;

Can anyone help me out please?
Thanks,