//PRINT ARRAY
for ($c=ord("A"); $c<=ord("Z"); $c++)
{ $sql="SELECT * FROM players_az WHERE
SUBSTRING(surname,0,1)='".chr($c)."'
ORDER BY surname,firstname ASC";
if ($result=mysql_query($currentplayers,$db))
while ($row[]=mysql_fetch_array($result))
{ print "$f";
print "$row[surname],$row[firstname]<br>";
}
}
Basically, you right a sql statement that will run each time a letter is incremented and then get the names for the statement. This is one way to do it.
This is really not the most efficient way, and if the list is large then you will pay a penalty. This will work fine for a small list or until you learn SQL a little better to write an improved statment.
This should work though. Check for mispellings or semicolons, I did not verify those things.