Re: Help with new function
I had similar that needed that recently.
Have you tried
$row = $wpdb->get_results( $wpdb->prepare(“SELECT user_login FROM $wpdb->users WHERE u.ID = %s”, $username) );
I think you access each individual column like this
see if this helps https://codex.wordpress.org/Function_Reference/wpdb_Class