If you mean select by first letter then wild cards are what you want ...

in your case "SELECT ... WHERE lastname LIKE '$Letter%' ORDER BY lastname"

... if you mean sort all records but don't sort past the first letter then
"SELECT ..., LEFT(lastname, 1) AS lastname_first ... ORDER BY
lastname_first" or you might even be able to do " ... ORDER BY
LEFT(lastname, 1)" you'll have to experiment with that one.

Tim Ward
Internet chess www.chessish.com <http://www.chessish.com> 

        From:  Chuck "PUP" Payne [SMTP:[EMAIL PROTECTED]]
        Sent:  11 March 2002 02:59
        To:  Cary; mysql lists.mysql.com
        Cc:  PHP General
        Subject:  Re: [PHP] Re: A stupid question...

        I want to sort my a letter in a set colomn. Let say I want to sort
        colomn last_name


        Like to create a link like A then sort only the last name ore what
ever I
        want to sort by that letter.

        I hope that's helps. I can order by, but I can't so a sort like the

        Chuck Payne
        Magi Design and Support

        on 3/10/02 9:42 PM, Cary at [EMAIL PROTECTED] wrote:

        > At 08:24 PM 3/10/02, Chuck \"PUP\" Payne wrote:
        >> Hi,
        >> I not a newie but I am not a pro at mysql either. I want to do a
query by
        >> letter(a, b, c..ect.). Is there a simple way to do it. I am
writing in PHP.
        >> So can someone please so me the how.
        > I'm not totally sure what your looking for. If you could elaborate
a little
        > I am sure that one of us could help you out.
        > Cary

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to