<?php
$con = mysqli_connect(localhost, restax, restax@123, Restax);     


$set_papers_id=$request->getParsedBody()['set_papers_id'];
$units=$request->getParsedBody()['units'];




		
$response=array();

$sql12="SELECT * FROM units WHERE set_papers_id='$set_papers_id' AND units='$units'";

$res12= $con->query($sql12);

if(mysqli_num_rows($res12) > 0)
{

$response2=array('status' => "true",'Message' => "Data Already Exits");

echo json_encode($response2);


}
else{
$sql="INSERT INTO units(set_papers_id,units) VALUES ('$set_papers_id','$units')";


$res= $con->query($sql);



	$data=array('name' =>$type, );


	    // $message=$data;

		

	$response=array('status' => "true",'Message' => "Data inserted successfully",$data);

echo json_encode($response);

}

 
?>