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

// Check if column exists
$check = $conn->query("SHOW COLUMNS FROM programs LIKE 'admission_criteria'");
if ($check->num_rows == 0) {
    // Add column
    $sql = "ALTER TABLE programs ADD COLUMN admission_criteria TEXT AFTER fee_per_semester";
    if ($conn->query($sql) === TRUE) {
        echo "Column 'admission_criteria' added successfully.";
    } else {
        echo "Error adding column: " . $conn->error;
    }
} else {
    echo "Column 'admission_criteria' already exists.";
}
?>
