<?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);



        $papers_id = $request->getAttribute('papers_id');
	    $papers_shortcode=$request->getParsedBody()['papers_shortcode'];
		$paper_name=$request->getParsedBody()['paper_name'];
		$credits=$request->getParsedBody()['credits'];
		
				
	$sql= ("UPDATE set_papers SET papers_shortcode='$papers_shortcode' , paper_name='$paper_name' , credits='$credits' WHERE papers_id=$papers_id");	
	
 if($con->query($sql)){
		$data=array(
"papers_id" => $papers_id,
	
	"papers_shortcode"=>$papers_shortcode,
	"paper_name"=>$paper_name,
	"credits"=>$credits,
	);
	    $message=$data;
	

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

?>