                                                                                                                                         
<?php

define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'restax');
define('DB_PASSWORD', 'restax');
define('DB_NAME', 'Restax');
$con = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);



        $id = $request->getAttribute('id');
		$rollnumber=$request->getParsedBody()['rollnumber'];
		$student_name=$request->getParsedBody()['student_name'];
		$detained=$request->getParsedBody()['detained'];
	  
		
				
	$sql= ("UPDATE set_student_season SET  rollnumber='$rollnumber', student_name='$student_name', detained='$detained' WHERE id=$id");	
	
 if($con->query($sql)){
		$data=array(
    "id" => $id,
	"rollnumber"=>$rollnumber,
	"student_name"=>$student_name,
	"detained"=>$detained,
	
	);
	    $message=$data;
	

	
	$response=array('status' => "true",'Message' => "Data updated successfully",'total_students' => $message);
echo json_encode($response);
        
}
        else{
          $response=array('status' => "false",'Message' => " update data failed");
         echo json_encode($response);
        }   
		
