<?php

//include '../config/db.php';
require_once __DIR__ . '/../config/db.php';

$census_no = $_POST['census_no'] ?? '';

$sql = "SELECT * FROM schools WHERE census_no=?";

$stmt =mysqli_prepare($conn,$sql);

mysqli_stmt_bind_param($stmt,"s",$census_no);

mysqli_stmt_execute($stmt);

$result = mysqli_stmt_get_result($stmt);

$data = mysqli_fetch_assoc($result);

header('Content-Type: application/json');

echo json_encode($data);