Thanks, that brings up my own results.
I've currently cut the code right back to see if I can just see a list of my staff.
without the %%USERID%% variable it just show a list of people who have put their own email address in the manager field by accident, or they manage themselves, Lucky people.
SELECT DISTINCT u.id AS userid, u.username AS staff, u.email AS email, uid.data AS manager
FROM prefix_user as u
JOIN prefix_user_info_data AS uid ON uid.userid = u.id
WHERE u.id = %%USERID%%
AND u.email = uid.data
I've currently cut the code right back to see if I can just see a list of my staff.
without the %%USERID%% variable it just show a list of people who have put their own email address in the manager field by accident, or they manage themselves, Lucky people.
SELECT DISTINCT u.id AS userid, u.username AS staff, u.email AS email, uid.data AS manager
FROM prefix_user as u
JOIN prefix_user_info_data AS uid ON uid.userid = u.id
WHERE u.id = %%USERID%%
AND u.email = uid.data