<?php

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

  $section_name=$request->getParsedBody()['section_name'];
		$questions=$request->getParsedBody()['questions'];  
  $marks_questions=$request->getParsedBody()['marks_questions'];
		$total_marks=$request->getParsedBody()['total_marks'];     
$paper_id=$request->getParsedBody()['paper_id'];     		

$response=array();


$sql="INSERT INTO set_sections(section_name,questions,marks_questions,total_marks,paper_id) 
VALUES ('$section_name','$questions','$marks_questions','$total_marks','$paper_id')";

$res= $con->query($sql);
	
if($res==true)
{
		$data=array(
	"section_name"=>$section_name,
	"questions"=>$questions,
	"marks_questions"=>$marks_questions,
	"total_marks"=>$total_marks,
	"paper_id"=>$paper_id,
	
	
	);
	    $message=$data;
	

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


?>