In my database I have a table that contains approximately 100 members. I am trying to create a directory where you can click on a letter from either A to Z to pull up all members with the last name starting with that letter only.
I can't seem to get the sort feature to work and am at a loss on what I am doing wrong, any help will be greatly appreciated. Below is what I was trying to do in my code:
$conn = db_connect();
$query = "SELECT DISTINCT SUBSTRING(last_name, 1, 1) FROM members WHERE last_name = '$letter'";
$result = @mysql_query($query);
$num_results = mysql_num_rows($result);
$i = 0;
while($row = mysql_fetch_array($result))
{
echo <P>".$row["last_name"].",."$row["first_name"]." \n";
}