set @list := '';
select @list := CONCAT(@list, STAFF_ID, ',') from STAFF_PROFILES WHERE LEFT(LAST_NAME, 1) = 'a';
SET @list = IF(LENGTH(@list)=0,'',LEFT(@list,LENGTH(@list)-1));
select USERNAME from STAFF where FIND_IN_SET(STAFF_ID, @list) > 0
only returns:
1,
1,2,
1,2,154,
1,2,154,123,
instead of the staff usernames like it does in the MySQL console or in PHP MyAdmin