Array( [id] => 1 [user_id] => 1 [year] => 2013-2014 [term] => 1)Array( [id] => 2 [user_id] => 1 [year] => 2013-2014 [term] => 2)Array( [id] => 3 [user_id] => 1 [year] => 2012-2013 [term] => 1)
If the above first in the case of the reverse of year, and then according to term 2 of the first query for 1 after query best with thinkphp
It should be found out.
Array( [id] => 2 [user_id] => 1 [year] => 2013-2014 [term] => 2)Array( [id] => 1 [user_id] => 1 [year] => 2013-2014 [term] => 1)Array( [id] => 3 [user_id] => 1 [year] => 2012-2013 [term] => 1)
Reply content:
Array( [id] => 1 [user_id] => 1 [year] => 2013-2014 [term] => 1)Array( [id] => 2 [user_id] => 1 [year] => 2013-2014 [term] => 2)Array( [id] => 3 [user_id] => 1 [year] => 2012-2013 [term] => 1)
If the above first in the case of the reverse of year, and then according to term 2 of the first query for 1 after query best with thinkphp
It should be found out.
Array( [id] => 2 [user_id] => 1 [year] => 2013-2014 [term] => 2)Array( [id] => 1 [user_id] => 1 [year] => 2013-2014 [term] => 1)Array( [id] => 3 [user_id] => 1 [year] => 2012-2013 [term] => 1)
ORDER
Keywords are available for multiple fields.
ORDER BY `year` DESC, `term` DESC