<?php
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json");

require_once "koneksi.php";

$result = $conn->query("SELECT * FROM clicks");
$data = [];

while ($row = $result->fetch_assoc()) {
    $data[$row['id_info']] = [
        "star" => $row['star'],
        "fire" => $row['fire'],
        "thumbs" => $row['thumbs']
    ];
}

echo json_encode($data);
$conn->close();
?>