Hi!
If you ONLY need the first letter of the filename, you have to do this:
eregi("([a-m0-9_])", $row->filename, $aux);
and then, in $aux[1] you should have the first letter of the filename.
I¡ve not tested what I'm telling you, but, in theory, it should work. Anyway, let me know if it works or doesn't =)
Bye... inK