<?php
header('Content-Type: application/json');
require_once 'config.php';

$dishes = [];
$result = $conn->query("SELECT id, name, price, image FROM menu_items ORDER BY id DESC");

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

echo json_encode([
    'success' => true,
    'dishes' => $dishes
]);
