Hi All,
I suspect this really can by done in my SQL query rather than afterwards
in PHP but I haven't been able to find a way.

I have a table with three fields:

1.  First_Name
2.  Last_Name
3.  Business_Name

A row that has a first and last name will not have a business name.  A
row with a business name will not have a first or last name set.

I want to output the contents of this (with filtering as appropriate)
into a select list in a form.

At the moment I am doing something like this for my SQL statement
(simplified for just the bit I need to figure out):

SELECT * FROM My_Table ORDER BY Business_Name, Last_Name, First_Name;

What I would _like_ to have happen is that the select list will end up
sorted by business name as well as last name and then first name.  At
the moment this query is resulting in all business names (sorted) and
then, following all business names, all last/first names (also sorted).

I want them all integrated into a single alphabetical list.

I don't seem to be making any headway searching the MySQL or PHP web
sites for this...

Thanks for any and all suggestions...

CYA, Dave

PHP General 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]

Reply via email to