Jump to content

PHP/MySql sort order query


streetwitch

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

Archived

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

×
×
  • Create New...