Results 1 to 10 of 10
Threaded View
-
08-24-2008, 08:24 PM #1Web Hosting Master
- Join Date
- Jun 2008
- Posts
- 1,471
PHP/MySQL Alphabetical List with Headings
I'm trying to do something like this, a database holds lets say the names of various music albums and I want to display them on a page alphabetically with headings for each letter of the alphabet.
A
-----
A Better Something
Alpha Something
Already Blah
B
-----
By the Way
Better Than Carp
(you get the idea)
The part I'm lost on is how to separate out stuff like @Name or !Test!, I would like to sort out all the stuff that doesn't start with a number or a letter of the alphabet. Not sure how I would do that with SQL. Any help would be appreciated.
Also, is the the best way of pulling out all entries starting with the letter A:
PHP Code:"SELECT name FROM albums WHERE name LIKE 'A%' ORDER BY name ASC"