$query = \DB::select( 'username' )
->from( 'users' )
->execute()
->as_array(null, 'username');
would return an array of username's. No iteration needed.* Return all of the rows in the result as an array.
*
* // Indexed array of all rows
* $rows = $result->as_array();
*
* // Associative array of rows by "id"
* $rows = $result->as_array('id');
*
* // Associative array of rows, "id" => "name"
* $rows = $result->as_array('id', 'name');
It looks like you're new here. If you want to get involved, click one of these buttons!