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

 
 

$sub_topics_id = $request->getAttribute('sub_topics_id');
$sub_topics_heading=$request->getParsedBody()['sub_topics_heading'];


 	$sql= "UPDATE  sub_topics SET sub_topics_heading='$sub_topics_heading' WHERE sub_topics_id=$sub_topics_id";

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

	$data=array('subject_main_topics' =>$sub_topics_heading, 'id' =>$sub_topics_id);
 

	

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

echo json_encode($response); 


?>