<?php
require_once 'shikanisha.kts.php';

$query = "SELECT * FROM pages ORDER BY page_name";
$result = $conn->query($query);

$pages = array();
while ($row = $result->fetch_assoc()) {
    $pages[] = $row;
}

header('Content-Type: application/json');
echo json_encode($pages);
$conn->close();
?>