Hi Anthony:
Anthony Rodriguez wrote:
>
> The following php script sends two (2) e-mails to each addressee. Why?
I'll bet the email addresses in question are listed in the table twice. Open
up a MySQL command line prompt and enter "select * from con_inf;" to make
sure. To keep this from happening, you can delete the duplicates then add a
unique index on the "e_mail" field in the MySQL table definition.
> $qry_1="select * from con_inf";
Side Issue 1: why are you selecting everything (via "*") rather than just
"e_mail", since that's all you're using in the script?
> $result_1=mysql_query($qry_1,$connection) or die ("No query # 1!");
>
> while ($row_1=mysql_fetch_array($result_1, MYSQL_ASSOC))
>
> {
> $e_mail=$row_1["e_mail"];
> mail("$e_mail",
Side Note 2: You can combiune those two lines into one:
mail($row_1['e_mail'],
> mysql_free_result($result_1);
> mysql_close($connection);
Side Note 3: You don't worry about these commands in scripts you're about to
exit anyway.
Enjoy,
--Dan
--
PHP scripts that make your job easier
http://www.analysisandsolutions.com/code/
SQL Solution | Layout Solution | Form Solution
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Ave, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php