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

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

$res = $mysqli->query("SELECT * FROM roles WHERE nama_role LIKE '%Dosen%'");
echo "Role Dosen:\n";
while($row = $res->fetch_assoc()) {
    print_r($row);
}
?>
