Jump to content

Recommended Posts

Hey,

I've created a database where my users (joomla users and CB) can point out that they would like to recieve emails.
This code gives me a nice overview of all the users their email, and with the echo I putted a , in between.

$result = mysql_query("SELECT email FROM voc_users LEFT JOIN voc_comprofiler ON voc_users.id = voc_comprofiler.user_id WHERE cb_mailing =1"); 
while ($row = mysql_fetch_assoc($result)) {
echo "" . $row['email'] . ", ";
}

But I would like to put the echo now in a variable (?) so that I can use this later on in a mailform.

Any ideas/suggestion how I should do this?

 

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/281368-mysql-lookup-into-mailform-mailto/
Share on other sites

Hey,

 

When I put this in array, I only have the latest email adres returned. :$

And I would like to have all adresses that have the option 1 selected (mail1@dom.com, mail2@dom.org, mai.....)

 

 

ps maybe it has something to do with the chronoengine I'm using under joomla?

This is the code so far: 

$result = mysql_query("
   SELECT email FROM voc_users 
   LEFT JOIN voc_comprofiler 
   ON voc_users.id = voc_comprofiler.user_id 
   WHERE cb_mailing = 1
   "); 

while ($row = mysql_fetch_assoc($result)) {
   $form->data['mailarray'] = $row['email'];
   }

Ahhh, this should be better, no?

$result = mysql_query("
   SELECT email FROM voc_users 
   LEFT JOIN voc_comprofiler 
   ON voc_users.id = voc_comprofiler.user_id 
   WHERE cb_mailing = 1
   "); 

while ($row = mysql_fetch_array($result)) {
    $mailarray[] = $row['email'];
   }

$form->data['BCC_mail'] = $mailarray;
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.