I think this is really simple, but I can’t get my head around it.
I would like to achieve something like this:
Get all names from database.
Get first letter for each name.
Show all 26 Alphabet characters + numbers:
A B C D E F etc…0-9
And only put a link on the characters, which are the first letter of a username. In other words something like this:
Usernames from database-> Moonwalker, Tester, Admin, Tutorial, Arial
All characters are visible:
A B C D E F G H I J K L M N O P Q R S
T U V W X Y Z 0 1 2 3 4 5 6 7 8 9
but only the letters that have the same first letter as usernames are linked to something:
A B C D E F G H I J K L M N O P Q R S
T U V W X Y Z 0 1 2 3 4 5 6 7 8 9
I know it’s possible, but I have no idea how to achieve this.
Thanks in advance.
This is how you can get the first letter:
This is how you can find users using first letter (with first
B):This is how you can get the list of first letters, that exist in database (with optional count of occurrences):