<?php
include 'db.php';
$result = $conn->query("SELECT id, cost_price FROM items");
$costs = [];

while ($row = $result->fetch_assoc()) {
    $costs[$row['id']] = floatval($row['cost_price']);
}

echo json_encode($costs);
