suttercain Posted August 25, 2007 Share Posted August 25, 2007 Hi everyone, I am making a simple mail form that will SELECT email address from a MySQL table based on the userid of the person sending the email. if (isset($_POST['submit'])) { require('../database.php'); $result = mysql_query("SELECT * FROM emailList WHERE merchantId = '".$_SESSION['id']."'") or die(mysql_error()); What would be the most efficient way of storing the email addresses from MySQL (may be 1 or may be 100) and then sending them in BCC to all the people gathered from the MySQL table? Thanks SC Quote Link to comment Share on other sites More sharing options...
suttercain Posted August 25, 2007 Author Share Posted August 25, 2007 PS. I know how to send the email, I just need to know how to make the addresses into a single variable. Quote Link to comment Share on other sites More sharing options...
suttercain Posted August 25, 2007 Author Share Posted August 25, 2007 Alright, I tried: [code] <?php if (isset($_POST['submit'])) { require('../database.php'); $result = mysql_query("SELECT emailAlerts FROM emailList WHERE merchantId = '".$_SESSION['id']."'") or die(mysql_error()); $row = mysql_fetch_array($result); $bcc = implode(", ", $row); echo $bcc; } ?> But it echoes the same email address twice instead of each separate address. Any suggestions? Thanks[/code] Quote Link to comment Share on other sites More sharing options...
j5uh Posted March 28, 2008 Share Posted March 28, 2008 this is something I'm looking for. any solutions out there? Quote Link to comment Share on other sites More sharing options...
discomatt Posted March 28, 2008 Share Posted March 28, 2008 Do you expect multiple rows to be returned in your SELECT query? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.