Sorry, that was me.
My point was that if you used the line: $uname = array($this->result -> username);
Each time your while loop iterates, it updates the array value with the latest value from the db.
However if you use: $uname[] = $this->result -> username; the first array key begins with an index of zero and each new value from the db gets added to the array with a new index incremented by 1.