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

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

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