mmm....it does not work like i want it....let me show u some of the code so u can understand better
$top = "SELECT * from topic";
$res_top = $db->query($top);
$topics = array();
while ($row_top = $res_top -> fetch_assoc())
{
$topics[$row_top['top_id']] = $row_top['max_stud'];
}
$super = "SELECT * from staff";
$res_staff = $db->query($super);
$staffs = array();
while($row_staff = mysqli_fetch_assoc($res_staff))
{
$staffs[$row_staff['staff_id']] = $row_staff['max_stud_no'];
}
so the topic and staff are not actually arrays but hash tables....and i think thats why rand does no play as supposed to be...