
<?php

$con = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
$set_sections_id=$request->getAttribute('set_sections_id');


$response=array();
if(isset($set_sections_id)){
	$sql="SELECT set_Q_papers.set_sections_id, set_Q_papers.Q_questions, set_Q_papers.marks_alloted, set_Q_papers.subsets, set_Q_papers.marks_for_subsets, set_Q_papers.ideal_time,
	set_sections.section_name
	FROM (set_Q_papers INNER JOIN set_sections ON set_sections.id=set_Q_papers.set_sections_id)
WHERE set_Q_papers.set_sections_id='$set_sections_id'	";
}
else{
	$sql="SELECT set_Q_papers.set_sections_id, set_Q_papers.Q_questions, set_Q_papers.marks_alloted, set_Q_papers.subsets, set_Q_papers.marks_for_subsets, set_Q_papers.ideal_time,
	set_sections.section_name
	FROM (set_Q_papers INNER JOIN set_sections ON set_sections.id=set_Q_papers.set_sections_id) ";
}



$result=mysqli_query($con,$sql);

    while ($row[]=mysqli_fetch_assoc($result)) {  

      $user=$row;

	}


echo json_encode($user);

?>