2014-01-03, 10:13 PM
I like to sort IPs in a meaningful order. When selecting banned IPs, I suggest we sort them based on octets:
Any wildcard bannings get sorted in the right place, too. ASCII sorting is almost meaningless.
$query = $db->simple_select("banfilters", "*",
"type='{$type}'",
array("order_by" => "INET_ATON(REPLACE(filter, '*', 0)), filter",
"order_dir"=>"asc"));
Any wildcard bannings get sorted in the right place, too. ASCII sorting is almost meaningless.