<?php 
include('../include/config.php');
if(!empty($_POST["id"])) 
{
  $cnt= $_POST["id"];
  $result =mysqli_query($con,"SELECT CBC2.*, pupils.Names as nam,pupils.AdmNo as adm from CBC2 left join pupils ON pupils.count=CBC2.PID where CBC2.id='$cnt'");
    $row=mysqli_fetch_array($result);
    echo json_encode($row);  
    }else
    {
      echo "Not found";
    }

?>