Yes, exactly. The A-Z is simple, since the value is directly wired in. I can get the rest, non-alpha be under # , like in your example. I guess I have to put some logic to select an appropriate query, sommething like:
if ($letter == '#') {
SELECT * FROM table WHERE name RLIKE "^[[:digit:]]";
} else {
DO MY OTHER THING
}
Am I on the right track here?