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




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


 	$sql= "UPDATE units SET units='$units' WHERE unit_id=$unit_id";

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

	$data=array('units' =>$units, 'id' =>$unit_id);
 

	

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

echo json_encode($response); 


?>