On 6/4/13 8:11 AM, Wade Shearer wrote:
> The reason that I can't do the sort in the SQL is because I am make
> four queries and then merging them first.

Can't you do a UNION, and then sort that?  If you post (or send me) your 
four queries, I can show you how to do it all in a single query 
including the sort.

If you really want to do it in the PHP code, I'd try this:

usort($all, function($a, $b) {
        $a_sort = ($a['type'] == 3 ? 6 : intval($a['type']));
        $b_sort = ($b['type'] == 3 ? 6 : intval($b['type']));
        if ($a_sort == $b_sort) return 0;
        return ($a_sort < $b_sort) ? -1 : 1;
}

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to