[Help] Loading a list of e-mails from SQL into a list.

HillTopMayhem

Registered Member
Joined
Jan 28, 2014
Messages
86
Reaction score
27
Total noob here.

Tried to google some things but I can't seem to find what I'm looking for. I have a SQL database of around 700 users with a bunch of details including there e-mail addresses, phpmyadmin and all that jazz. Is there a way I can send all the e-mails to a txt so I can use them?

Thanks.
 
If you have phpmyadmin installed than it would be rather easy to run a query and export to txt file. Have you tried to generate a query result with phpmyadmin?
 
MrBlue, when I say I'm a total noob... I do have phpmyadmin installed.

I know im asking to basically be spoonfed, sorry.
 
:1:
1. open phpmyadmin and click ur database, if its wp default then it mus b smt like wrdp bla bla
2. click SQL and insert ur Query there, something like select user_email from wp_users
3. export to csv
 
Also, you can do this in php, for future visitors.

PHP:
<?php

$link = mysql_connect('localhost', 'root', 'password');
if (!$link) {
    die('Not connected : ' . mysql_error());
}
$db_selected = mysql_select_db('databasename', $link);
if (!$db_selected) {
    die ('Can\'t use databasename : ' . mysql_error());
}

$result = mysql_query("SELECT * FROM table_name") 
or die(mysql_error());  
while($row = mysql_fetch_array( $result )) {

$cust_email = $row['cust_email'];
echo $cust_email;
echo"<br>\n";
?>
 
Back
Top