开发者

How to place data on mysql to php array()

开发者 https://www.devze.com 2023-01-07 13:25 出处:网络
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());

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 :)

0

精彩评论

暂无评论...
验证码 换一张
取 消