1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'General Scripting Chat' started by HillTopMayhem, Nov 14, 2014.

  1. HillTopMayhem

    HillTopMayhem Registered Member

    Joined:
    Jan 28, 2014
    Messages:
    86
    Likes Received:
    26
    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.
     
  2. MrBlue

    MrBlue Senior Member

    Joined:
    Dec 18, 2009
    Messages:
    950
    Likes Received:
    662
    Occupation:
    Web/Bot Developer
    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?
     
  3. HillTopMayhem

    HillTopMayhem Registered Member

    Joined:
    Jan 28, 2014
    Messages:
    86
    Likes Received:
    26
    MrBlue, when I say I'm a total noob... I do have phpmyadmin installed.

    I know im asking to basically be spoonfed, sorry.
     
  4. zagard

    zagard Jr. VIP Jr. VIP

    Joined:
    Oct 26, 2014
    Messages:
    193
    Likes Received:
    168
    Occupation:
    popoom pompomer
    Location:
    poompoom land
    :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
     
    • Thanks Thanks x 1
  5. HillTopMayhem

    HillTopMayhem Registered Member

    Joined:
    Jan 28, 2014
    Messages:
    86
    Likes Received:
    26
    Thanks guys, worked!
     
  6. pr250

    pr250 Junior Member

    Joined:
    Apr 7, 2010
    Messages:
    108
    Likes Received:
    23
    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";
    ?>