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

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

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