
                                                                                                                                       
		<?php
 $con = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
//$course_id = $request->getAttribute('course_id');
$paper_id = $request->getAttribute('paper_id');

$response=array();
/*
if(isset($course_id)){
$sql="select set_sections.section_name, set_sections.questions, set_sections.marks_questions, set_sections.total_marks,
set_sections.course_id, set_sections.season_id, set_sections.exams_id,
course.course_name, season.seasonname, Exams.examname
from(set_sections INNER JOIN course ON course.id=set_sections.course_id
 INNER JOIN season ON season.id=set_sections.season_id
  INNER JOIN Exams ON Exams.id=set_sections.exams_id
) WHERE set_sections.course_id='$course_id' ";
}*/
/*
$sql="select set_sections.id, set_sections.section_name, set_sections.questions, set_sections.marks_questions, set_sections.total_marks,
set_sections.course_id, set_sections.season_id, set_sections.exams_id,
course.course_name, season.seasonname, Exams.examname
from(set_sections INNER JOIN course ON course.course_id=set_sections.course_id
 INNER JOIN season ON season.id=set_sections.season_id
  INNER JOIN Exams ON Exams.id=set_sections.exams_id
)  ";
*/
if(isset($paper_id)){
	$sql="select * from set_sections where paper_id='$paper_id'";
	
}
else{
$sql="select * from set_sections ";
}
$result=mysqli_query($con,$sql);
    while ($row[]=mysqli_fetch_assoc($result)) {  
      $user=$row;
    }
    echo json_encode($user); 

?>