Jump to content

Mysql lookup into mailform (mailto)


Brononius

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 ([email protected], [email protected], 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;

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.