<?php
$con = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
$response=array();
$course_id=$request->getAttribute('course_id');
if(isset($course_id)){
$sql="(SELECT * FROM season WHERE course_id ='$course_id' AND  status='1')";
}

 $result=mysqli_query($con,$sql);
    while ($row[]=mysqli_fetch_assoc($result)) {  
      $user=$row;
    }

echo json_encode($user);

?>