                                                                                                                                         


<?php

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


        $id = $request->getAttribute('id');
       
		$section_name=$request->getParsedBody()['section_name'];
		$questions=$request->getParsedBody()['questions'];
		$marks_questions=$request->getParsedBody()['marks_questions'];
		$total_marks=$request->getParsedBody()['total_marks'];
		
				
	$sql= ("UPDATE set_sections SET section_name='$section_name' , questions='$questions', marks_questions='$marks_questions', total_marks='$total_marks' WHERE id=$id");	
	
 if($con->query($sql)){
		$data=array(
   
	"section_name"=>$section_name,	
	"questions"=>$questions,
	"marks_questions"=>$marks_questions,	
	"total_marks"=>$total_marks,
	);
	    $message=$data;
	

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

?>
