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.
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
Like to create a link like A then sort only the last name ore what
want to sort by that letter.
I hope that's helps. I can order by, but I can't so a sort like the
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:
>> I not a newie but I am not a pro at mysql either. I want to do a
>> 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
> I am sure that one of us could help you out.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php