<?php
$mysqli = new mysqli("127.0.0.1", "root", "", "siakad");

if ($mysqli->connect_error) {
    die("Connection failed: " . $mysqli->connect_error);
}

$queries = [
    "ALTER TABLE `mahasiswa` ADD COLUMN `id_mahasiswa_pddikti` VARCHAR(36) NULL AFTER `id`;",
    "ALTER TABLE `mahasiswa` ADD COLUMN `id_registrasi_mahasiswa` VARCHAR(36) NULL AFTER `id_mahasiswa_pddikti`;",
    "ALTER TABLE `mahasiswa` ADD COLUMN `angkatan` VARCHAR(10) NULL AFTER `status_mahasiswa`;"
];

foreach ($queries as $sql) {
    if ($mysqli->query($sql)) {
        echo "Success: $sql\n";
    } else {
        echo "Error or already exists: " . $mysqli->error . "\n";
    }
}
?>
