$Value) { $Priorities[$Key] = $Value['priority']; } array_multisort($Priorities, SORT_ASC, $TypeList); } else { $TypeList = $Types['master']; } if(!array_key_exists($NewType, $TypeList)) { echo "No resolve from that category"; die(); } $DB->query("UPDATE reportsv2 SET Type = '".$NewType."' WHERE ID=".$ReportID);