<?php
include 'includes/db.php';

// Check if columns exist
$check = $conn->query("SHOW COLUMNS FROM applications LIKE 'academic_year'");
if ($check->num_rows == 0) {
    // Add columns
    $sql = "ALTER TABLE applications ADD COLUMN academic_year VARCHAR(10) DEFAULT '2024', ADD COLUMN session VARCHAR(10) DEFAULT 'Fall'";
    if ($conn->query($sql) === TRUE) {
        echo "Columns 'academic_year' and 'session' added successfully.";
    } else {
        echo "Error adding columns: " . $conn->error;
    }
} else {
    echo "Columns already exist.";
}
?>
