treyb an even safer method would be to just put that script outside of the webroot, hard-code the password (or include
it from Flarum's config.php
) and run the script over the command line with php scriptname.php
. The same code should work just fine over the CLI. You don't even need the header()
calls, and you could directly write to a file, or continue writing to PHP output and then redirect it on the shell like php scriptname.php > output.csv
😉
To address the original question, if you have a tool like phpMyAdmin, you can easily export an entire table to CSV, ODS or XLS. In phpMyAdmin, you can also run the same SQL query as suggested by treyb and then choose export at the bottom of the results page. It'll produce the same result as the PHP script.
You might want to use SELECT email FROM users WHERE is_email_confirmed = 1
query to only select users with a confirmed email address.
luceos maybe you were thinking of my Mailchimp extension? It's not compatible anymore and was for some very special use case.