How to export the email addresses from a particular membergroup?

Started by aksal, May 12, 2019, 06:16:24 PM

Previous topic - Next topic

aksal

What query do I want to run to export the email addresses from a particular membergroup?
I use SMF 2.0.15
Thank you.

Oldiesmann

Michael Eshom
Christian Metal Fans

vbgamer45

You would need to run an sql query via phpmyadmin or another tool from the smf_members table where id_group = group id you need
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Illori

what is the reason you want to export their email addresses? if it is to send an email to them you can do that using the newsletter function.

aksal

Quote from: Illori on May 13, 2019, 06:30:12 PM
what is the reason you want to export their email addresses? if it is to send an email to them you can do that using the newsletter function.

It takes like forever if I use the build in Newsletter function because I have a lot of users. That's why I need to export the addresses and use an external tool for sending emails.

aksal

Quote from: vbgamer45 on May 13, 2019, 05:59:12 PM
You would need to run an sql query via phpmyadmin or another tool from the smf_members table where id_group = group id you need

What would be the right query for this?
Thanks

vbgamer45

select email_address from smf_members where id_group = ###
### replace with group id
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Oldiesmann

Might want to change that last part to "id_group = ### OR FIND_IN_SET(###, additional_groups)" to catch any members who are in that group but don't have it as their primary group.
Michael Eshom
Christian Metal Fans

aksal

Quote from: vbgamer45 on May 13, 2019, 10:33:39 PM
select email_address from smf_members where id_group = ###
### replace with group id

MySQL returned an empty result set (i.e. zero rows). (Query took 0.0005 seconds.)

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

aksal

Thank you guys, but still nothing.
I tried with
select email_address from smf_members where id_group = 7 OR FIND_IN_SET(7, additional_groups)
And with
select email_address from smf_members where id_group = 7 OR FIND_IN_SET(4, additional_groups)
and I get this again and again
MySQL returned an empty result set (i.e. zero rows). (Query took 0.0431 seconds.)

Sir Osis of Liver

You'll get an empty result if id_group is not a valid membergroup.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

And those ids look like post count groups... are they post count groups?

Biology Forums

Posting just to bookmark the topic. Good question and great answers!

aksal

Quote from: Arantor on May 28, 2019, 06:23:36 PM
And those ids look like post count groups... are they post count groups?

Yes, post count groups.

Arantor

Would have been nice to know this, since not knowing this wasted everyone's time thus far.

select email_address from smf_members where id_post_group = 7

m4z

How/why should a user  or casual admin know there's a difference between postcount-based and normal groups?
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

Arantor

Because they don't act like other groups. Also, it's just courteous to provide as much information up front rather than having to pull it out later.

aksal

Quote from: Arantor on May 29, 2019, 07:38:16 AM
Would have been nice to know this, since not knowing this wasted everyone's time thus far.

select email_address from smf_members where id_post_group = 7

It worked perfectly now. Thank you very much.

Advertisement: