replace
Code:
$sqlplayer = odbc_exec($con,"SELECT TOP $limit * FROM Character WHERE CID not in (SELECT TOP $start CID FROM Character ORDER BY XP DESC) AND DeleteFlag='0' ORDER BY Level DESC,XP DESC,KillCount DESC,DeathCount DESC");
with:
Code:
$sqlplayer = odbc_exec($con,"SELECT TOP $limit * FROM Character WHERE CID not in (SELECT TOP $start CID FROM Character ORDER BY XP DESC) AND DeleteFlag='0' ORDER BY Level DESC,XP DESC,KillCount DESC,DeathCount DESC AND NOT NULL (SELECT * FROM Account WHERE Account.AID = Character.AID AND Account.UGradeID < 252) ");
I'm not 100% sure I wrote the query correctly, I haven't touched sql in months