How to place data on mysql to php array()
I have about 50 users in a database and I want to send them a newsletter.
开发者_Go百科$result = mysql_query("SELECT email FROM users") or die(mysql_error());
$row = mysql_fetch_array( $result ); // had 50 emails
How do I put the $row['email']
into the mail code below.
$m->setBcc(Array("email@email.com", "email2@email.com","email3@email.com"));
Let me know.
$recipients = array();
while($row=mysql_fetch_array($result))
{
$recipients[] = $row['email'];
}
$m->setBcc($recipients);
tell me if it doesn't work and I'll immediately delete it :)
精彩评论