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



$chapter_id = $request->getAttribute('chapter_id');


	$sql="DELETE FROM chapter WHERE chapter_id='$chapter_id'";	

	
 
 if($con->query($sql)){

		$data=array(

"chapter_id" => $chapter_id,

	//"course_name"=>$course_name,

	);

	    $message=$data;

	

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

echo json_encode($response);


        

}

        else{

          $response=array('status' => "false",'Message' => " delete data failed");

         echo json_encode($response);
      

        }   




?>