I'm a newbie in PHP. Here's my code:
$email_db = mysql_query("SELECT emails FROM email_feeds") or die(mysql_error());
$recipients = array();
while($row = mysql_fetch_assoc( $email_db )){
$recipients[] = $row;
}
$sendTo = implode(', ', $recipients);
echo($sendTo);
What I'm trying to do here is get the data from the column emails from the email_feeds table in my database, then put it in an array ($recipients) then echo it in a comma separated form.
E.g. john@mysite.com, mike@mysite.com, claire@mysite.com
My problem is when I run it it shows an "Array to string conversion" notice.
Please help! :)