<?php 
include('../include/config.php');
if(!empty($_POST["id"])) 
{
    $id= $_POST["id"];
    $sql = "SELECT * FROM CBC1 where mid='$id'";
    $result = $con->query($sql);
    while($row = $result->fetch_assoc()) 
    {
         $grd=$row['Grad'];
         $exa=$row['EID'];
    }
    
    $result =mysqli_query($con,"SELECT * FROM examsetting WHERE examid='$exa' AND Grad='$grd'");
    $row=mysqli_fetch_array($result);
    echo json_encode($row);
    }else
    {
      echo "Not found";
    }
?>