Export email addresses from database

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
Svensktgolfforum
Registered User
Posts: 6
Joined: Thu Nov 15, 2018 7:54 am

Export email addresses from database

Post by Svensktgolfforum » Thu Nov 15, 2018 8:02 am

I have been able to use this snippet for the last four years, to export my users e-mails. The reason behind it is because I add them to Mailchimp and send them newsletters about the forum.

Code: Select all

SELECT user_email FROM phpbb_users WHERE user_allow_massemail=1
But yesterday I realized that the users that had registered after june/july wasn´t int the exported csv file from when I ran the script above.

Does anyone have a new snippet that works or know why this isn´t working anymore?

Svensktgolfforum
Registered User
Posts: 6
Joined: Thu Nov 15, 2018 7:54 am

Re: Export email addresses from database

Post by Svensktgolfforum » Thu Nov 15, 2018 8:48 am

So something I tried that seemed to work and I want to share is

Code: Select all

SELECT user_email FROM phpbb32_users


I updated the

Code: Select all

FROM phpbb_users
--> to

Code: Select all

FROM phpbb32_users

User avatar
KevC
Support Team Member
Support Team Member
Posts: 68482
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Export email addresses from database

Post by KevC » Thu Nov 15, 2018 8:56 am

That query would be looking at the users from a completely different installation of phpBB as the table prefix is different.
One installation is in a database with tables prefixed with phpbb_ and one with phpbb32_
They are not the same board.

Code: Select all

SELECT user_email FROM phpbb_users WHERE user_type <> 2
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

User avatar
david63
Jr. Extension Validator
Posts: 15087
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Export email addresses from database

Post by david63 » Thu Nov 15, 2018 9:22 am

Another option is to use this extension - viewtopic.php?f=456&t=2401101
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

Svensktgolfforum
Registered User
Posts: 6
Joined: Thu Nov 15, 2018 7:54 am

Re: Export email addresses from database

Post by Svensktgolfforum » Thu Nov 15, 2018 10:48 am

david63 wrote:
Thu Nov 15, 2018 9:22 am
Another option is to use this extension - viewtopic.php?f=456&t=2401101
Thanks I will look into this one.

One question, the downloaded file was named this, david63-userdetails-3.2 3
Can I upload that entire folder in to root/ext/????

User avatar
david63
Jr. Extension Validator
Posts: 15087
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Export email addresses from database

Post by david63 » Thu Nov 15, 2018 10:54 am

Svensktgolfforum wrote:
Thu Nov 15, 2018 10:48 am
One question, the downloaded file was named this, david63-userdetails-3.2 3
Can I upload that entire folder in to root/ext/????
It needs to have the structure ext/david63/userdetails/
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
warmweer
Registered User
Posts: 1516
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Export email addresses from database

Post by warmweer » Fri Nov 16, 2018 10:52 am

Svensktgolfforum wrote:
Thu Nov 15, 2018 8:02 am
I have been able to use this snippet for the last four years, to export my users e-mails. The reason behind it is because I add them to Mailchimp and send them newsletters about the forum.

Code: Select all

SELECT user_email FROM phpbb_users WHERE user_allow_massemail=1
But yesterday I realized that the users that had registered after june/july wasn´t int the exported csv file from when I ran the script above.

Does anyone have a new snippet that works or know why this isn´t working anymore?
The way I understand your post is that you want to export a list with username and user_email. What's preventing you from exporting that data from the users_table (and even exporting other data from other tables in order to perform queries).

Perhaps no user registered after June/July has allowed massemail?
A bug is a feature that hasn't made it to the manual (yet)

Svensktgolfforum
Registered User
Posts: 6
Joined: Thu Nov 15, 2018 7:54 am

Re: Export email addresses from database

Post by Svensktgolfforum » Fri Nov 16, 2018 10:56 am

david63 wrote:
Thu Nov 15, 2018 10:54 am
Svensktgolfforum wrote:
Thu Nov 15, 2018 10:48 am
One question, the downloaded file was named this, david63-userdetails-3.2 3
Can I upload that entire folder in to root/ext/????
It needs to have the structure ext/david63/userdetails/
I managed to install it now and THANK YOU MISTER! What a masterpiece of extension. Love it. It will be extremely helpful to me.

I need to keep on exploring extension.

Post Reply

Return to “[3.2.x] Support Forum”

Who is online

Users browsing this forum: No registered users and 30 guests