Jump to content

Displaying Lists


ChompGator

Recommended Posts

What Iam trying to do is just get one column of my table in phpmyadmin that stores email address to just list all the email address in the 'email' column.

 

Im trying to get just the email addresses listed on the page so I can copy/paste them into an email. The easiest way I know to do this is just get my php script to list the email address on the page so I can copy them all. Is there an easier way to do this, perhaps get php to copy it to a text file or something? Anyway there is 150 email addresses in the column so I figured itd be easy to just get a php script to list all the email address so I can copy them. Here is my script, what is wrong with this? :( Its not listing anything when I upload it

 

<?php
$con = mysql_connect("******","******","******") or die('Could not connect: ' . mysql_error());
mysql_select_db("login", $con);

$result = mysql_query("SELECT * FROM subscribe");

while($row = mysql_fetch_array($result))
  {
$row['email'];
  }
mysql_close($con);
?>

Link to comment
Share on other sites

<?php
$con = mysql_connect("******","******","******") or die('Could not connect: ' . mysql_error());
mysql_select_db("login", $con);

$result = mysql_query("SELECT * FROM subscribe");

if (!is_array($result)) { die("Result returned non-array"); }
while($row = mysql_fetch_array($result))
  {
print ($row['email'] . "<br>");
  }
mysql_close($con);
?>

Link to comment
Share on other sites

Ok, geeze one problem, its listing the email address, is there a way to make it list the email address and put a comma between each one, for copy.pasting purposes?

 

Actualy, I think its a semi colon that separates email address, so it'd have to be a semi colon, but be that as it may - is there a way to do this?

Link to comment
Share on other sites

I hope this is for legit purposes  >:(

 

<?php
$con = mysql_connect("******","******","******") or die('Could not connect: ' . mysql_error());
mysql_select_db("login", $con);

$result = mysql_query("SELECT * FROM subscribe");

if (!is_array($result)) { die("Result returned non-array"); }
while($row = mysql_fetch_array($result))
  {
$emails .= ($row['email'] . ",");
  }

print ($emails);
mysql_close($con);
?>

Link to comment
Share on other sites

haha, it is.

 

What is happening is, Im on the board for an organization and we're sending out an monthly newsletter, and this is the only way I know of to get a list of registered members, to send the newsletter to.

 

I posted a topic weeks back, about any good Mailing systems, or tutorials on how to create one for my website, but the topic didn't get any replies. Basically, though Ive thought about it, and it probably isn't that hard is it? Itd be pretty much creating a login (Which is done) and having a link for board members to click, 'Create NewsLetter' allow them to type their content, and then hit send, and have it automatically send off the server right? But Im unsure as to how to using the sending feature with php, I could probably figure it out, but my whole thing is this, the reason Id like someone to recommend a good tutorial for me to create a NewsLetter system like this is because, I want to be able to add graphics to the newsletter where necessary.

 

But then I read if I create the newsletter in Microsoft Publisher it has an email function on it, so I can just hit 'email' and enter the addresses and it will email the newsletter in HTML format. So Im not sure what the most efficient way to creat a newsletter system is.

 

- Thanks for the help!

 

Ps if you know any good tutorials, let me know!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.