I see a couple of errors, one of which is the source of your problem. You write: "SELECT name FROM thetable WHERE (nome=$leter%) ORDER BY nome ASC"; This would evaluate to "SELECT name FROM thetable WHERE (nome=A%) ORDER BY nome ASC";
What you need to write is: "SELECT name FROM thetable WHERE (nome like '$leter%') ORDER BY nome ASC";
"like" is required to make regular expression match. The quotes are always required when dealing with strings (and a few other types).