<?php
$con = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
$response=array();

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

$sql="SELECT * FROM subject_main_topics WHERE chapter_id=$chapter_id";
$result=mysqli_query($con,$sql);
    while ($row[]=mysqli_fetch_assoc($result)) {  
      $cors=$row;
    }
    echo json_encode($cors);
  
?>