Sorry for double posting but I really need to find out how to fix the code I have right now.
The problem right now is: Users with UGrade 255 cannot demote users which are below its rank.
Tried to edit it, unsure on how to... 
PHP Code:
if( $type != 2 && num_rows($query02) != 1 )
{
setmessage("Rank Change", $_STR[Acc16]);
redirect("index.php?do=accounts");
die();
}
else
{
//Let's check if the user is staff or not.
$query = odbc_exec($connection, "SELECT UGradeID FROM {$_CONFIG[AccountTable]}(nolock) WHERE $part = '$id'");
odbc_fetch_row($query);
$ugradeid = odbc_result($query, 1);
//If the ugrade is 252 OR 254 OR 255. (OR = ||)
if ($ugradeid == 252 || $ugradeid == 254 || $ugradeid == 255)
{
setmessage("Rank Change", "You do not have permission to demote admins.");
redirect("index.php?do=accounts");
die();
}
//Extra protection to prevent your staff from updating someone to staff. (Except if the staff member's UGrade 255)
if ($rank == 252 || $rank == 254 || $rank == 255 && $_SESSION['UGradeID'] != 255)
{
setmessage("Rank Change", "You do not have permission to promote users.");
redirect("index.php?do=accounts");
die();
}
odbc_exec($connection, "UPDATE {$_CONFIG[AccountTable]} SET UGradeID = '$rank' WHERE $part = '$id'");
writetolog( sprintf($_STR[Log2], $part, $id, $rank) );
setmessage("Rank Change", $_STR[Acc19]);
redirect("index.php?do=accounts");
die();
}
} //Prevent unexpected end of die();