Jump to content

PHP/MySql sort order query


Recommended Posts

Hi - I'm fairly new to using php and mysql and am hoping that this is a simple question. I need to do what I would describe as a nested sort order: I have a list of names which I want to sort firstly by a flag, and secondly in alphabetical order.Here's my code:$query_artists = "SELECT artist_id, artist_name, `new` FROM artists WHERE setting_flag = 'S' ORDER BY artist_name ASC";So I want to order by a field called 'new' (and alphabetically for all records with the flag), and then the remainder alphabetically.Can anyone help?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...