<?php
header('Content-Type: application/json; charset=utf-8');
include('../connection.php');

$result = $conn->query('SELECT id, title FROM issue ORDER BY id ASC');
$data = [];

if ($result) {
    while ($row = $result->fetch_assoc()) {
        $data[] = [
            'id' => (int) $row['id'],
            'title' => $row['title']
        ];
    }
}

echo json_encode($data, JSON_UNESCAPED_UNICODE);
