<?php
require "../model/DB.php";
if ($_SESSION['role'] == "ADMIN") {
$DB = new DB();
$results = $DB->updateUserRole($_POST["userId"], $_POST["role"]);
echo json_encode(count($results) == 0 ? null : $results);
}