Re: Emails from database...
| From: | David Robley | Date: | Thu, 05 Apr 2001 07:53:56 +0000 |
| Subject: | Re: Emails from database... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47196@lists.php.net to get a copy of this message | ||
On Thu, 5 Apr 2001 16:27, you wrote:
> Hi!
>
> Do u mean the code should be like this?
>
>
> $connect = mysql_connect();
> $query = "select email from table";
> $execute = mysql_db_query("database", $query);
> while($r=mysql_fetch_array($execute))
> {
> $try = $r('email');
Your syntax is wrong here - see the example in the docs for
mysql_fetch_array
> $email .= $try . ";";
and multiple addresses are separated by comma
> }
>
> mail("$email", "My Subject", "Line 1\nLine 2\nLine
> 3");
>
It might be wise to just echo what you are proposing to pass to mail()
until you get it right.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA