										                                                                                                         

<?php



$con = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
     
		$set_sections_id=$request->getParsedBody()['set_sections_id'];
		$set_Q_papers_id=$request->getParsedBody()['set_Q_papers_id'];
		$set_questions=$request->getParsedBody()['set_questions'];
		$options=$request->getParsedBody()['options'];
			json_decode($options,true);


$resultEncoded = json_encode($options);
$response=array();

$sql="INSERT INTO question_pattern(set_sections_id,set_Q_papers_id,set_questions,options) VALUES ('$set_sections_id','$set_Q_papers_id','$set_questions','$resultEncoded')";

$res= $con->query($sql);
	
if($res==true)
{
		$data=array(
	
	"set_sections_id"=>$set_sections_id,
	"set_Q_papers_id"=>$set_Q_papers_id,
	"set_questions"=>$set_questions,
	"options"=>$options,
	
	);
	    $message=$data;

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



?>