Order by multiple columns work this way.
For example, you have 4 records.
field1 | field2 | field3 | field4
-------+-------+--------+----------
1 | 1 | 2 | 4
-------------------------------------
2 | 2 | 100 | 5
-------------------------------------
3 | 2 | 1 | 3
-------------------------------------
4 | 3 | 500 | 6
-----------------------------------
5 | 2 | 1 | 2
If your query is,
$query = "select * from table order by field2,field3,field4";
the result would be,
field1 | field2 | field3 | field4
-------+-------+--------+----------
1 | 1 | 2 | 4
-------------------------------------
5 | 2 | 1 | 2
---------------------------------------
3 | 2 | 1 | 3
-------------------------------------
2 | 2 | 100 | 5
-------------------------------------
4 | 3 | 500 | 6
-------------------------------------
As you can see, it sorts field2 first. Then it sorts field3 maintaining the order of field2. Then maintaining the order of field2 and field3, it sorts field4.
I know my explanation isn't really good ! (Or is it more confusing ?)
Note: If you don't specify how you want to sort your records, it will sort in ascending order by default.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*