[PHP-DB] ABC listings

2002-01-07 Thread Barry Rumsey

One last question for tonight as I have been given alot of help from this group to 
keep me going for awhile.

I would like to set up one of those  A B C D E F  page listings. How do i query the 
database to grab the first letter from each entrey.



Re: [PHP-DB] ABC listings

2002-01-07 Thread Marty Landman

At 01:48 AM 1/8/02 +1300, Barry Rumsey wrote:

I would like to set up one of those  A B C D E F  page listings. How do 
i query the database to grab the first letter from each entrey.

Barry try something such as

select info from mytab
where name like $ltr%;

Marty


Website Creation Made SIMPL(tm)
http://face2interface.com/Home/Demo.shtml
WebSafe Color Picker -- http://face2interface.com/WebSafe


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] ABC listings

2002-01-07 Thread Kodrik

On Monday 07 January 2002 04:48 am, Barry Rumsey wrote:
 One last question for tonight as I have been given alot of help from this
 group to keep me going for awhile.

 I would like to set up one of those  A B C D E F  page listings. How do i
 query the database to grab the first letter from each entrey.

$firstletter=a

... where textfield='$firstletter*' and ...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] ABC listings

2002-01-07 Thread DL Neil

 I would like to set up one of those  A B C D E F  page listings. How do 
 i query the database to grab the first letter from each entrey.
 
 Barry try something such as
 
 select info from mytab
 where name like $ltr%;


Barry,

What you have asked for (from each entrey [sic]) is:
SELECT LEFT( colNm, 1 ) FROM tblNm;

However what may be of more use is:
SELECT DISTINCT LEFT( colNm, 1 ) FROM tblNm;

6.3.2  String Functions
6.4.1  SELECT Syntax

=dn



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]