Hey,
I've created a database where my users (joomla users and CB) can point out that they would like to recieve emails.
So now I'm trying to make a form that allows me to send a mail directly to all recipients.
This code gives me a nice overview of all the users their email, and with the echo I putted a , in between.
But I would like to put the echo now in a variable (?) so that I can use this later on in a mailform. When I put this into an array, I've got only the latest mail address (not all).
Any ideas/suggestion how I should do this?
Thanks!
I've created a database where my users (joomla users and CB) can point out that they would like to recieve emails.
So now I'm trying to make a form that allows me to send a mail directly to all recipients.
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. When I put this into an array, I've got only the latest mail address (not all).
$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'];
}
Any ideas/suggestion how I should do this?
Thanks!