Jump to content

Alphabetize and Group by First Letter


xProteuSx

Recommended Posts

I have a DB of countries, and I would like to list them alphabetically, and also by letter heading.  I know how to list them alphabetically, and I also know how to list just the A's, B's, C's etc.  but I only know how to do this using multiple DB queries.  Is there any way to do this with a single query? ...

 

A: Afghanistan, Albania, Algeria, Angola, etc etc

B: Bahamas, Bahrain, Bangladesh, etc etc

C: Cambodia, Cameroon, Canada, etc etc

etc ...

Link to comment
https://forums.phpfreaks.com/topic/136471-alphabetize-and-group-by-first-letter/
Share on other sites

Hmm ... I have a bad habit of avoiding arrays, because I have never used them before.  I guess that its time for me to learn.  After all, they are SUPER important.  I will figure this out tomorrow.  Thanks for your suggestion (which is probably 100% right).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.