I have a query that retrieves records from a table:
<?php
$query = "select * FROM Ev_AvVolunteers where id_Event='$id_Event' ORDER BY Name";
$results = mysql_query($query) or die("Error performing query");
?>
It is sorting by Name now BUT I want a different sort. There is another field called "Instrument" which contains what instrument they will be playing. I know I can change the "ORDER BY Name" to "ORDER BY Instruments and ORDER BY Name" which will group the values together BUT I still need a different sort order: The order I need is by Priority. I need it like this:
Leader
Singer
Piano
Synth
A-Guitar
E-Guitar
Bass
Drums
Perc
Sax
Flute
Other
After it sorts by this list, then I want to Sort by Name. So it will produce an example list like this:
Smith, Bill - Leader
Hanster, Tom- Singer
Raller, Jen - Singer
Tombs, Sara - Singer
Joel, Billy - Piano
Taylor, James - A-Guitar
Carlton, Larry - E-Guitar
Flea - Bass
Peart, Neil - Drims
etc...
You get the idea ;-)
I appreciate if someone can show the code on how to get that work.
Thanks!