Re: In search of help with a MySQL DB
| From: | Jason Beebe | Date: | Mon, 18 Dec 2000 03:32:03 +0000 |
| Subject: | Re: In search of help with a MySQL DB | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-5305@lists.php.net to get a copy of this message | ||
<?
$getinfoSQL = "SELECT name, email FROM users"
$users_result = mysql_query($getemailSQL);
$subject = "This Is Our Email Subject";
while ( $row_users = mysql_fetch_array($users_results)){
$username = $row_users["name"];
$email_addr = $row_users["email"];
$mailbody = "Dear $username,\n\n
This is the message we will be sending... blahh blahh blah\n\n
Sincerely,\n
The Staff";
mail ($email_addr, $subject, $mailbody);
}
exit();
?>
hope that helps. if you have no experience with using mysql with php i
suggest you generalize yourself with the subject at hotscripts.com, look
under php tutorials. you must know the basics before you can write code.
----- Original Message -----
From: James McLaughlin <katana@montrose.net>
To: <php-db@lists.php.net>
Sent: Sunday, December 17, 2000 8:00 PM
Subject: [PHP-DB] In search of help with a MySQL DB
> Hello
>
> I have a question concering a database I am working with. We have
> recently made some changes to our company policies and I need to send a
> email to everyone in the database. We have a User table within xxxx db.
>
> From what I can tell this is what I need to do:
>
> SELECT Email FROM Users
> Then Email a message to all of the email addeys in the Email column
>
> Is php capable of doing this, or would I need to look at a perl/cgi
> script?
>
> If PHP is capable of doing something like this, could someone show me an
> example script of how this is done, or point me to an area where I could
> learn?
>
> Thanks In Advance
>
> James McLaughlin
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>