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

// Get beverage categories
$query = "SELECT DISTINCT cat FROM beverages UNION SELECT DISTINCT food_group FROM food";
$result = $conn->query($query);
$data = [];

while ($row = $result->fetch_assoc()) {
    $data[] = $row['cat'];
}

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