Just use the sql select query and not php to do the work for you.
Your select statement should be:
"select * from table where name like \"$letter%\" order by name DESC"
//edited
I didn't explain the % sign tho. If you are just running a query (forget about php for now) your sql statement would be
"select * from table where name like "J%" order by name DESC" would return every record that starts with "J" in the field "name".
"select * from table where name like "Jas%" order by name DESC" would return every record that starts with "Jas" in the field "name".
"select * from table where name like "%J" order by name DESC" would return every record that ends with "J" in the field "name".
"select * from table where name like "%Jas%" order by name DESC" would return every record that contain "Jas" anywhere in the field "name".
Hope this makes sense.