Jump to content

help with sorting multiple levels


Gmunky

Recommended Posts

There is a list from a database I want to be able to print out and sort them by last name within first name but also if there

isn't a name, I want to print out the company name in alphabetical order first and then the names.

 

fname | lname | company name|

-------------------------------

james|  blunt |                    |

John  | blunt|

bryan |  wilson|                      |

        |          |focus co.        |

        |          |    gap            |

 

 

I want to be able to print out in this sort of order:

 

focus co.

gap

blunt, james

blunt, john

wilson,bryan

 

 

 

My query is 'Select * from table order by lname,fname asc']

 

The problem with this is that the company names are not in order.

Link to comment
https://forums.phpfreaks.com/topic/45731-help-with-sorting-multiple-levels/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.