I am aware of the fact that I can usort an array by one column using something like this:
function cmp($a, $b)
{
return $b['column'] - $a['column'];
}
usort($array, "cmp");
This simulates the ORDER BY column DESC
.
What if I want to simulate the ORDER BY column1 DESC, column2 ASC
or ORDER BY column1, column2 DESC
or also by more columns? Is it possible with PHP or it's pretty much a work that just SQL can do? Thanks.