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

// Check the connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM invoice";
$result = mysqli_query($conn, $sql);

// Create array to hold products
$products = array();

// Loop through results and add to array
while ($row = mysqli_fetch_assoc($result)) {
    $products[] = $row;
}

// Return array as JSON
echo json_encode($products);

// Close database connection
mysqli_close($conn);
?>