$pullEmails = mysql_query("SELECT COUNT(*) FROM Subscribe;"); while($pullEmails > 0)) {
$getEmail = mysql_query("SELECT Email from Subscribe where PersonId = " . $pullEmails . ";"); $subject = "Test mail"; $message = "test email to all the subscribers"; $from = "admin@codefundamentals.com"; $headers = "From:" . $from; mail($getEmail,$subject,$message,$headers); $pullEmails = $pullEmails - 1; }
I have a database and I want it emailed to all the people in the database.I have a PersonId row, Name row, and Email row. It’s possible that people may unsubscribe and delete their row thus I may eventaully have my personid row be like
1
2
3
5
9
11
12
etc. How would you best account for this?