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

$res = $mysqli->query("SHOW COLUMNS FROM dosen LIKE 'nuptk'");
if ($res->num_rows == 0) {
    $mysqli->query("ALTER TABLE dosen ADD COLUMN nuptk VARCHAR(50) NULL AFTER nidn");
    echo "Column nuptk added.\n";
} else {
    echo "Column nuptk already exists.\n";
}
?>
