I'm a newbie but this code below should simply select all and order it first by the numeric "year" field, and within each result with the same year sub-order it alphabetically by the "lastname" field.
$query = "SELECT * FROM table ORDER BY year,lastname";
But what I need to do is sort things by a non-numeric and non-alphabetic order.
One option could be like this:
"Spring 2002"
"Fall 2002"
"Spring 2003"
"Fall 2003"
You see how (without changing the data itself) this has an intended order but couldn't be ordered alphabetically.
Another option (and the one I'm trying to do right now) could be like this:
"Alpha"
"Beta"
"Gamma"
"Delta"
"Zeta"
"Eta"
Here you can see how this has an intended order (greek alphabet spelled out) but couldn't be ordered alphabetically.
So is there a way that I can pre-define the order to be used in the mySQL query? Is there a way for me to say Alpha=1, Beta=2, Gamma=3, and so forth and have my query order it my way? Instead of the code I used at the top, I'd like it to work kind of like this...
$query = "SELECT * FROM table ORDER BY my_designated_order_for_fieldname,lastname";
but how?