MyBB Community Forums
Exporting email addresses. - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html)
+------ Thread: Exporting email addresses. (/thread-105399.html)

Pages: 1 2


Exporting email addresses. - anothervenue - 2011-10-06

The systems mass email function isn't strong enough for me to do a newsletter. Is there a way to export all my users email addresses so I can use a newsletter program?


RE: Exporting email addresses. - Paul H. - 2011-10-07

Create a php file in your root directory with these contents:
<?php
define("IN_MYBB",1);
include("global.php");
$result = $db->query("SELECT * FROM ".TABLE_PREFIX."users")

while ($row = $db->fetch_array($result, MYSQLI_NUM)) {
echo $row['email']."<br />";
}
?>

Excecute it and it should echo all email addresses.


RE: Exporting email addresses. - dthiago - 2013-08-01

(2011-10-07, 12:37 AM)Paul H. Wrote: Create a php file in your root directory with these contents:
<?php
define("IN_MYBB",1);
include("global.php");
$result = $db->query("SELECT * FROM ".TABLE_PREFIX."users")

while ($row = $db->fetch_array($result, MYSQLI_NUM)) {
echo $row['email']."<br />";
}
?>

Excecute it and it should echo all email addresses.

Parse error: syntax error, unexpected T_WHILE in /home/bf4br419/public_html/forum/email.php on line 6


RE: Exporting email addresses. - .m. - 2013-08-01

^ add a semicolon at end of line 4 , that is after $result = $db->query("SELECT * FROM ".TABLE_PREFIX."users")


RE: Exporting email addresses. - dthiago - 2013-08-01

(2013-08-01, 08:12 AM).m. Wrote: ^ add a semicolon at end of line 4 (after $result = $db->query("SELECT * FROM ".TABLE_PREFIX."users"))



<?php
define("IN_MYBB",1);
include("global.php");
$result = $db->query("SELECT * FROM ".TABLE_PREFIX."users"))

while ($row = $db->fetch_array($result, MYSQLI_NUM)) {
echo $row['email']."<br />";
}
?>


Like this?



Another error

Parse error: syntax error, unexpected ')' in /home/bf4br419/public_html/forum/email.php on line 4



RE: Exporting email addresses. - .m. - 2013-08-01

^
<?php
define("IN_MYBB",1);
include("global.php");
$result = $db->query("SELECT * FROM ".TABLE_PREFIX."users");

while ($row = $db->fetch_array($result, MYSQLI_NUM)) {
echo $row['email']."<br />";
}
?>



RE: Exporting email addresses. - caygri - 2015-04-12

I copy and create the file but it's white page, it's normal?


RE: Exporting email addresses. - .m. - 2015-04-12

oh! you can use code like below
<?php
define("IN_MYBB",1);
include("global.php");
$result = $db->query("SELECT * FROM ".TABLE_PREFIX."users");
while ($row = $db->fetch_array($result)) {
echo $row['email']."<br />";
}
?>



RE: Exporting email addresses. - caygri - 2015-04-17

just replace it?


RE: Exporting email addresses. - .m. - 2015-04-17

^ yes. you can use that code in a php file, upload it to your MyBB files server (where you have global.php file) & execute it