<?php
require 'shikanisha.kts.php';

$query = "SELECT tot_id, name, quantity, created_at, price FROM tots";
$result = $conn->query($query);

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

$response = array(
    "data" => $data
);

echo json_encode($response);

$conn->close();
?>
