php-general | 2001062
Date: 06/30/01
- Next message: Julia A. Case: "Re: [PHP] reading records alphebetically"
- Previous message: teo <email protected>: "Re: [PHP] Urgent Help: Problem with apache+php"
- In reply to: Jamie Saunders: "[PHP] reading records alphebetically"
- Next in thread: Julia A. Case: "Re: [PHP] reading records alphebetically"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
If you are planning to have a lot of records, you may want to create a
column with just that letter and index it, followed by the full name.
SELECT name from Table
WHERE first_letter = "$letter"
ORDER by name
should produce pretty fast results if "first_letter, name" is indexed.
Warren Vail
-----Original Message-----
From: Jamie Saunders [mailto:jamie.s <email protected>]
Sent: Saturday, June 30, 2001 10:30 AM
To: php-general <email protected>
Subject: [PHP] reading records alphebetically
Hi,
I have a MySQL database set-up containing a few hundred records. I'm trying
to make a script that reads the 'name' field of the records and displays
only the records of which the name field begins with a specific letter:
if ($letter = A) {
display all records of which field 'name' beings with A
} else if ($letter = B) {
...
I'm just starting out on this, so please excuse my ignorance :)
Jamie Saunders
jamie.s <email protected>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Julia A. Case: "Re: [PHP] reading records alphebetically"
- Previous message: teo <email protected>: "Re: [PHP] Urgent Help: Problem with apache+php"
- In reply to: Jamie Saunders: "[PHP] reading records alphebetically"
- Next in thread: Julia A. Case: "Re: [PHP] reading records alphebetically"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

