<?php

/* Attempt to connect to MySQL database */
/* Attempt to connect to MySQL database */
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'restax');

define('DB_PASSWORD', 'restax@123');

define('DB_NAME', 'Restax'); 

$con = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);


$course_id=$request->getParsedBody()['course_id'];
 $season_id = $request->getParsedBody()['season_id'];
  $exams_id = $request->getParsedBody()['exams_id'];
  $paper = $request->getParsedBody()['paper'];
  $slots=$request->getParsedBody()['slots'];
  $roll_number = $request->getParsedBody()['roll_number'];
  $student_name=$request->getParsedBody()['student_name'];
 $response=array();
 $data=array();



  $sql="INSERT INTO set_student_exampre (course_id,season_id,exams_id,paper,slots,roll_number,student_name) VALUES ($course_id,$season_id,$exams_id,$paper,$slots,$roll_number,$student_name)";
$res=mysqli_query($con,$sql);
if ($res=true) {
     $data=
        array(
          "Exam_id"=>$exams_id,
         );
    
    $message=$data;

$response=array('status' => "true",'Message' => "Set Students Succesfully",'Exam' => $message);
echo json_encode($response);
        }
        else{
          $response=array('status' => "false",'Message' => "Set Students Failed");
         echo json_encode($response);
        }
?>