Solved

Alphabetical Navigation List

Posted on 2001-09-17
1
391 Views
Last Modified: 2010-05-18
I have a long list of items from a DB query and I want to create a navigation bar showing the alphabet with each letter highlighted if there are items begining with that letter. What is the simpliest way to compare my list to the alphabet for this purpose, or easier yet, can I design my query to return a list of all letters used. I know there must be a simple way to do this.
0
Comment
Question by:td234
1 Comment
 
LVL 4

Accepted Solution

by:
heddesheimer earned 50 total points
ID: 6488758
If you have a field "name" in your DB you can try this:

select LEFT(name, 1) as sort_char from table group by sort_char

will just return one record for each Alphabet letter that is in your database

hope that helps

Marian
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now