<?php
require("../includes/config.php");

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

$stmt = $pdo->query("
    SELECT id, chapter_name 
    FROM chapters 
    WHERE status=1 
    ORDER BY chapter_order ASC
");

echo json_encode($stmt->fetchAll(PDO::FETCH_ASSOC));
