<?php
require 'db_connection.php';

$sql = "SELECT parent_id, name FROM parents";
$result = $conn->query($sql);
$parents = [];

if ($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
        $parents[] = $row;
    }
}

echo json_encode($parents);
?>
