Part 1
I have to send out an email ASAP to 158 people based on certain criteria. The SELECT query works fine when I run it against the database and returns the correct 158 records. To test it, I changed the email address to mine so I could see what gets sent, but I thought I would get 158 emails. Instead I received only one. It seems to be sending to the first record only.
I can't figure out why my WHILE loop is not looping through all 158 records. The includes should not be causing any problems as the email itself had all the variables filled in correctly. I've been looking at it too long. Can anyone see what I cannot? Thanks!
Code:<?php include('cr-connectdb.php'); require('class.phpmailer.php'); $sql = "SELECT * FROM `booking` WHERE `Book_Date` < '2010-6-30' "; $result = mysql_query($sql,$connection) or die("Couldn't execute $sql query"); while($row = mysql_fetch_assoc($result)){ include('load-booking-variables.php'); $body = file_get_contents($Email_Alamo_Refund); include('replace-email-variables.php'); $Subject = "Notice Regarding Your Hawaii Car Rental"; $emailaddress = $Email; include('send-client-email.php'); } ?>



Reply With Quote



Bookmarks