<?php
include 'db.php';
$result = $conn->query("SELECT id, name FROM items WHERE item_role = 'material' ORDER BY name ASC");
$data = [];
while ($row = $result->fetch_assoc()) {
    $data[] = $row;
}
echo json_encode($data);
