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

try {
    $stmt = $pdo->query('DESCRIBE site_analytics');
    $columns = $stmt->fetchAll(PDO::FETCH_ASSOC);
    echo 'Structure de site_analytics:' . PHP_EOL;
    foreach ($columns as $col) {
        echo '- ' . $col['Field'] . ' (' . $col['Type'] . ')' . PHP_EOL;
    }

    echo PHP_EOL . 'Structure de site_events:' . PHP_EOL;
    $stmt = $pdo->query('DESCRIBE site_events');
    $columns = $stmt->fetchAll(PDO::FETCH_ASSOC);
    foreach ($columns as $col) {
        echo '- ' . $col['Field'] . ' (' . $col['Type'] . ')' . PHP_EOL;
    }

    echo PHP_EOL . 'Structure de page_performance:' . PHP_EOL;
    $stmt = $pdo->query('DESCRIBE page_performance');
    $columns = $stmt->fetchAll(PDO::FETCH_ASSOC);
    foreach ($columns as $col) {
        echo '- ' . $col['Field'] . ' (' . $col['Type'] . ')' . PHP_EOL;
    }

} catch (Exception $e) {
    echo 'Erreur: ' . $e->getMessage();
}
?>