What SQL query do i write to do this....

Discussion in 'MySQL' started by netpox, Dec 28, 2007.

  1. #1
    Hi,
    I need to pull all the email addresses from my database and put them in a format like this:

    ,
    ,
    ,
    etc..............

    Here are the tables that i have

    sEmailUser - table that has all the emails
    sUsernameUser - table that has all the usernames
    nldUser - table that has all the user id

    let me know if you can...thanks
     
    netpox, Dec 28, 2007 IP
  2. lggmaster

    lggmaster Peon

    Messages:
    233
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    if you are only needing a list of emails in this format with a link, then query your email table, and add a code like below

    while ($row =  mysql_fetch_array($query_string, MYSQL_ASSOC)) {
      echo '<a href="mailto:' . $row['email_address'] . '">' . $row['email_address'] . '</a>,<br>';
    }
    Code (markup):
    should work fine for ya
     
    lggmaster, Dec 28, 2007 IP
  3. netpox

    netpox Active Member

    Messages:
    1,625
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Hi,
    I dont mean to display it on a website i want a query that i can run in SQL and get results for the query i enter.
     
    netpox, Dec 30, 2007 IP
  4. kendo1979

    kendo1979 Peon

    Messages:
    208
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    remove the echo part, and add in the command you want there
     
    kendo1979, Dec 30, 2007 IP
  5. kyrogenic

    kyrogenic Peon

    Messages:
    172
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Im, looking to do the same thing and am wondering where do you input this command? Also, will it save it as a text file that I can put into my cpanel mailing list so I can group mail all members?
     
    kyrogenic, Dec 31, 2007 IP
  6. tushardhoot1

    tushardhoot1 Active Member

    Messages:
    3,013
    Likes Received:
    96
    Best Answers:
    0
    Trophy Points:
    90
    #6
    You input the command through PhpMyAdmin, and you can also export the table and certain fields (I think.) through there in certain formats.

    You can also code a script to retrieve the emails and email them for you.
     
    tushardhoot1, Dec 31, 2007 IP
  7. kendo1979

    kendo1979 Peon

    Messages:
    208
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    do you have php background?

    the result can be saved into textfile, or placed in database, anywhere you want :)
     
    kendo1979, Jan 1, 2008 IP