If you are trying to find all the files that start with a certain letter, you would want to do:
$query = "SELECT * FROM archiveTBL where filename like '$letter%'";
This will work as long as your database table has a column named 'filename'. If not, you'll need to use the correct column name or a variable to represent the column name.