aewhite901
Posts: 36
|
| Posted: 01/22/2005, 6:13 AM |
|
Hi folks,
I need to construct a single string as follwos
me@here.there.com,more@some.com, and so on...
I have been iterating thorugh the database but cannot seem to
construct the string. Each email address is returned correctly.
The idea is to use the "Undisclosed Recipeints" method of emailing
to minimize the imapct on my email server.
Can someone suggest how I might build this strings please?
thanks
Tony White
|
 |
 |
Martin K.
|
| Posted: 01/23/2005, 2:07 AM |
|
Hello.
You can make the string like this code:
global $NewGrid1;
// New db Connection
$db = new clsDBConnection1(); // Your connection
$Max_Mail = 1000;
$ShownMail = 0;
$SQL = "SELECT email FROM users WHERE 1"; // Your SQL Statement
$db->query($SQL);
$Result = $db->next_record();
if($Result && $ShownMail < $Max_Mail)
{
do {
$the_mail[] = $db->f("email");
$ShownMail++;
$is_next_record = $db->next_record();
} while ($is_next_record && $ShownMail < $Max_Mail);
}
else // Show NoRecords are found
{
echo "NoRecords are found";
}
#############################################################################
// Print the String comma separated
$comma_separated_string = implode(",", $the_mail);
echo "$comma_separated_string";
greets martin
|
|
|
 |
Martin K.
|
| Posted: 01/27/2005, 12:14 AM |
|
Whats Up?
Works?
Martin
|
|
|
 |
aewhite901
Posts: 36
|
| Posted: 01/27/2005, 2:58 AM |
|
Thanks Martin,
Sory, I forgot all about leaving the question.
Appreciate your efforts and yes it does work.
thanks again
Tony White
|
 |
 |
|