Hi Fastsol - thanks for the reply.
I kept it short as I didn’t expect anyone to write it for me. I’m still stuck so any advice would be great. I started down the route of PDO on my website and I have come unstuck with this which gives me the message “could not select members” so I need to re-write it but I am hopeless at languages. I did something similar to this a while ago which I originally borrowed from another forum:
<?php
$username = "****";
$password = "****";
$hostname = "localhost";
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
$selected = mysql_select_db("members",$dbhandle)
or die("Could not select members
");
$sql = mysql_query("select email from members");
$recipients = array();
while($row = mysql_fetch_array($sql)) {
$recipients[] = $row['email'];
}
$sql = mysql_query("select message from members");
$message = array();
while($row = mysql_fetch_array($sql)) {
$message[] = $row['message'];
}
$to = '
[email protected]';
$subject = "Latest Updates";
$body = ($message) . "\r\n";
$headers = 'From:
[email protected]' . "\r\n" ;
$headers .= 'Reply-To:
[email protected]' . "\r\n";
$headers .= 'BCC: ' . implode(', ', $recipients) . "\r\n";
mail($to, $subject, $body, $headers); ?>