$array = array();$result = $db->query_read("SELECT * FROM `user` WHERE `usergroupid` = 'X'");while($row = mysql_fetch_assoc($result)){array_push($array, $row['username'])}//Output: All the usernams with the usergroupid Xprint_r($array);