<?php
$conn = new mysqli("localhost", "root", "", "bella");
$result = $conn->query("SELECT id, name, price, image, slug FROM products");

$products = [];

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

header('Content-Type: application/json');
echo json_encode($products);

$conn->close();
?>
