<?php

define('DB_SERVER', 'localhost');

define('DB_USERNAME', 'Restax_final');

define('DB_PASSWORD', 'Restax_final123');

define('DB_NAME', 'Restax_api_data'); 

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




$set_grade_id = $request->getAttribute('set_grade_id');
$range_in=$request->getParsedBody()['range_in'];
$grade=$request->getParsedBody()['grade'];


 	$sql= "UPDATE set_grade SET range_in='$range_in',grade='$grade' WHERE set_grade_id=$set_grade_id";

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

	$data=array('grade' =>$grade, 'id' =>$set_grade_id);
 

	

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

echo json_encode($response); 


?>