<?php
    require_once('config.php');
    require_once('students.php');

    // Create an instance of the student class
    $studentObj = new Student($conn);
    
    $url = 'https://aguila.onrender.com/api/v2/briatekresults';
    $response = file_get_contents($url);

if ($response === FALSE) {
    die('Error occurred while fetching data.');
}

// Decode the JSON response
    $studentResults = json_decode($response, true);
    $studentObj->addStudentResult($studentResults);
?>