I'm probably doing this the wrong way, but I'm trying to sort my rankings by a Kill/Death ratio.
My current code:
PHP Code:
elseif( $_POST['sort'] == "ratio" )
{
$getratio = ratio(KillCount, DeathCount);
$sqlplayer = odbc_exec($connect, "SELECT TOP $limit AID, CID, Level, XP, KillCount, DeathCount, ".$getratio." FROM Character WHERE CID not in (SELECT TOP $start CID FROM Character WHERE DeleteFlag='0' ORDER BY $getratio DESC, Level DESC,XP DESC, KillCount DESC, DeathCount DESC) AND DeleteFlag='0' ORDER BY $getratio DESC, Level DESC,XP DESC, KillCount DESC, DeathCount DESC");
}
Since I'm doing this sorting in a Pagination function, I was thinking of doing the calculation function first then sorting it in a DESC matter (the higher percentage of k/d would be at the top of the ranking) while also being inside the Pagination.
Also, any help of allowing alt codes to go through the website without sacrificing security would be helpful as well. htmlentities would block them all, and I can't exactly create an allowed list for it since it will only take one string and not an array. (Would have converted the allowed character back into their alt codes using html_entites_decode) Strip_tags works, but it's either the DB or the script that's still converting it. Characters like "ß" are working, but ones like other characters like ε, and Ω are converted into "&# 949;" and all.
Thanks.