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

echo "Checking student_subjects table structure:\n\n";

try {
    $stmt = $pdo->query('DESCRIBE student_subjects');
    $columns = $stmt->fetchAll(PDO::FETCH_ASSOC);
    
    foreach ($columns as $col) {
        echo $col['Field'] . ' | ' . $col['Type'] . ' | ' . $col['Null'] . ' | ' . $col['Key'] . ' | ' . ($col['Default'] ?? 'NULL') . ' | ' . $col['Extra'] . "\n";
    }
    
    echo "\nChecking students table structure:\n\n";
    
    $stmt = $pdo->query('DESCRIBE students');
    $columns = $stmt->fetchAll(PDO::FETCH_ASSOC);
    
    foreach ($columns as $col) {
        echo $col['Field'] . ' | ' . $col['Type'] . ' | ' . $col['Null'] . ' | ' . $col['Key'] . ' | ' . ($col['Default'] ?? 'NULL') . ' | ' . $col['Extra'] . "\n";
    }
    
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
?>