// fetch_school_categories.php

<?php
include_once 'connect.php';

// Check if level_id is provided
if (isset($_POST['level_id'])) {
    $level_id = $_POST['level_id'];

    // Fetch school categories
    $query = "SELECT cate_id AS id, school_type FROM school_cate ORDER BY school_type ASC";
    $result = $conn->query($query);

    $options = "<option value=''>All School Categories</option>";
    while ($row = $result->fetch_assoc()) {
        $options .= "<option value='" . $row['id'] . "'>" . $row['school_type'] . "</option>";
    }
    echo $options;
}
?>
