<?php
require_once __DIR__ . '/config/db.php';

echo "=== Categories ===\n";
$cats = $pdo->query("SELECT id, name, image, slug FROM categories ORDER BY id")->fetchAll();
foreach ($cats as $c) {
    echo "ID {$c['id']}: {$c['name']} | slug={$c['slug']} | image={$c['image']}\n";
}

echo "\n=== Products ===\n";
$prods = $pdo->query("SELECT id, name, image, category_id, stock FROM products ORDER BY id")->fetchAll();
foreach ($prods as $p) {
    echo "ID {$p['id']}: {$p['name']} | cat={$p['category_id']} | image={$p['image']} | stock={$p['stock']}\n";
}
