1234567891011121314151617181920212223 |
- <?php
-
- require_once 'config.php';
- require_once 'dbh.inc.php';
- require_once 'checkLogin.php';
-
-
- // EXAMPLE INPUT...
- // array(1) { ["researcherID"]=> string(1) "3" }
-
- $researcherID = mysqli_real_escape_string($connection, trim($_POST['researcherID']));
-
- // Check if name is not an empty string
- if($researcherID === '') {
- http_response_code(400);
- echo json_encode(array("error" => "Must specify researcher ID."));
- exit();
- }
-
- // Insert user
- $queryManager = "UPDATE researcher SET admin = '1' WHERE id_researcher = '$researcherID';";
- mysqli_query($connection, $queryManager) or die("Error: " . mysqli_error($connection));
-
|