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

// Add pincode column if it doesn't exist
$sql = "ALTER TABLE job_applications ADD COLUMN pincode VARCHAR(10) NOT NULL AFTER state";

if ($conn->query($sql) === TRUE) {
    echo "Table 'job_applications' updated: Added 'pincode' column successfully.<br>";
} else {
    // Check if error is "Duplicate column name"
    if (strpos($conn->error, "Duplicate column name") !== false) {
         echo "Column 'pincode' already exists.<br>";
    } else {
         echo "Error updating table: " . $conn->error . "<br>";
    }
}

echo "<a href='careers.php'>Go to Careers Page</a>";
?>
