XF 2.0 Download list of members with member ID #

PJK

Active member
I'm looking to download list of members with member ID #, 1 colum each. Is this possible?

Additionally, there is a public profile field I'd like to include as column 3. And if easy, column 4 would be DOB (if public). How can I download these?

Thanks.
 
Do you have direct database access? This will get you user_id and username

SQL:
SELECT
xf_user.user_id,
xf_user.username,
FROM xf_user
ORDER BY xf_user.user_id ASC

If you want the custom field named 'XXXXX' and the birthdate components, try this:

SQL:
SELECT
xf_user.user_id,
xf_user.username,
xf_user_field_value.field_value,
xf_user_profile.dob_day,
xf_user_profile.dob_month,
xf_user_profile.dob_year
FROM xf_user
LEFT JOIN xf_user_field_value ON xf_user.user_id = xf_user_field_value.user_id
LEFT JOIN xf_user_profile ON xf_user.user_id = xf_user_profile.user_id
WHERE xf_user_field_value.field_id='XXXXX'
ORDER BY xf_user.user_id ASC

If you want to show the birthday only if the user has it selected to display, you'll have to join the xf_user_option table, then use a conditional statement on show_dob_date and show_dob_year. Good luck.
 
  • Like
Reactions: PJK
Top Bottom