I have a foreach loop which prints out the usernames of all entries in a database table like so:
foreach($results as $result){
echo $result->username;
echo '<br>';
}
As more and more users are added to the table, the list will grow. I would like to take the complete list and assign each entry to a separate PHP variable for use later on the PHP script. What is the best way to do this?