Results 1 to 4 of 4
Aug 27, 2000, 22:19 #1
i have got myself in a bit of a twist and i cannot find an answer.
the components are 1) a form to collect information. 2) a table in mysql to hold the data 3) a page to display the data each time the page is accessed. 4) a small part of the collecting program that eMails me when the form is submitted. 5) a table with two cols -id and eMail.
1) 2) 3) 4) work fine togeather. now i want to query 5 and put the results in place of eMail to me.
i know the format for the email is because it works.
mail($mailTo, $mailSubject, $mailBody);
the thing i want to do is query the email table, string all of them togeather in the form "1","2","3" and put them into the proggy in place of the "firstname.lastname@example.org".
the part i seem to be missing is proper query and then moving this data into the $mailTo=
i need some advice on this one.
Aug 27, 2000, 23:25 #2
- Join Date
- May 2000
- 0 Post(s)
- 0 Thread(s)
ok, i think you want to get a list of emails from the db and then email them all
$result = mysql_result("SELECT email FROM table");
while($row = mysql_fetch_array($result))
$email = $row['email'];
$mailTO = $email;
// your code for actually sending the mail goes here
we eat, live, sleep PHP, do you need a php host?
Aug 28, 2000, 12:02 #3
and thanks for the help.
i will try it in a little while.
Aug 29, 2000, 00:22 #4
i have tried the code you sent and it works just fine.
one of the things i am going to need to do is maintain a level of confidentiality. so i am going back to rework the code and start with a count of the emails in the table, then iterate through, sending the "new entry" message to each of the entries.
when i submitted the problem to the forum, i did not know that the array would expose all the listings to each member. but i also did not know how to write the code. i can now complete the code with the changes.
thanks for the help. it is just the thing i needed.