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

try {
    $db = getDB();
    
    echo "<h2>Connections Table Structure:</h2>";
    $stmt = $db->query('DESCRIBE connections');
    echo "<table border='1'><tr><th>Field</th><th>Type</th><th>Null</th><th>Key</th></tr>";
    while($row = $stmt->fetch()) {
        echo "<tr>";
        echo "<td>" . $row['Field'] . "</td>";
        echo "<td>" . $row['Type'] . "</td>";
        echo "<td>" . $row['Null'] . "</td>";
        echo "<td>" . $row['Key'] . "</td>";
        echo "</tr>";
    }
    echo "</table>";
    
    echo "<h2>Sample Data:</h2>";
    $stmt = $db->query('SELECT * FROM connections LIMIT 5');
    $data = $stmt->fetchAll();
    echo "<pre>" . print_r($data, true) . "</pre>";
    
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}
?>
