<?php
$db = new mysqli('localhost', 'root', '', 'siakad');
if ($db->connect_error) {
    die("Connection failed: " . $db->connect_error);
}
$res = $db->query("SELECT id, nim, id_mahasiswa_pddikti FROM mahasiswa WHERE id_mahasiswa_pddikti = '' OR id_mahasiswa_pddikti IS NULL LIMIT 5");
while ($r = $res->fetch_assoc()) {
    print_r($r);
}
