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


 

$main_topics_id = $request->getAttribute('main_topics_id');
$main_topics=$request->getParsedBody()['main_topics'];


 	$sql= "UPDATE subject_main_topics SET main_topics='$main_topics' WHERE main_topics_id=$main_topics_id";

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

	$data=array('subject_main_topics' =>$main_topics, 'id' =>$main_topics_id);
 

	

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

echo json_encode($response); 


?>