<?php 
include('../include/config.php');
    if(!empty($_POST["grd"])) 
{
    $cla=$_POST["grd"];

    $result =mysqli_query($con,"SELECT * FROM pupils WHERE Claz='$cla'");
    $row=mysqli_fetch_array($result);
    echo json_encode($row);
}
?>