
<?php 

define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'Restax_final');

define('DB_PASSWORD', 'Restax_final123');

define('DB_NAME', 'Restax_api_data'); 

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



$response=array();

// 	$sql="SELECT question_pattern.*,set_sections.total_marks,set_Q_papers.marks_alloted FROM question_pattern INNER JOIN set_sections ON  set_sections.id = question_pattern.set_sections_id INNER JOIN set_Q_papers.id = question_pattern.set_Q_papers_id WHERE question_pattern.id = '$id'";

	$sql="SELECT question_pattern.*,set_sections.total_marks,set_Q_papers.marks_alloted FROM question_pattern INNER JOIN set_sections ON  set_sections.id = question_pattern.set_sections_id INNER JOIN set_Q_papers ON set_Q_papers.id = question_pattern.set_Q_papers_id WHERE question_pattern.set_Q_papers_id = '$id' AND question_pattern.set_sections_id = '$set_sections_id'";


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

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

      $user=$row;

	}


echo json_encode($user);

?>