I want to query a table in a mysql database and display the results in a list format like this:
A – G, H-p, Q-z
So all results with the first letter of their name starting with A to G will display under A – G and so on.
What is the best way to do this in php? can it all be done in the query itself? Or will I have to sort it in the php.
Got any examples of something similar?
You can do it in SQL:
Or, in one query,