Hi there all,
Hoping someone can help me with this. Ive searched for a while and cant seem to find anything on this topic.
I have a website where people upload aviation photos to. The uploaded photos then go into a 'queue' (ie: the information is inserted into a 'queue' table.
I then review the photos to see if they are accpetable for the site. If i click on the "accept" button, the information gets inserted into a temp database, one of the fields in the database is 'status'. Should the photos be accepted, then the word 'accepted' is inserted into the field. Should the photo be reject, then the word 'rejected' is inserted into this field.
What i then want to do is have a "process batch" type of thing, where i press a button (or a link) which sends an email out to all of those records waiting in this temp table, and then clears the temp table out. Now here is the bit i dont understand.
Clearly, there may be people in the temp table that have more than one photo that they have uploaded in that session. So what i want to try and do is have an email that looks something like the following.
Dear Name,
your photos have been processed.
Photo "filename" was "status"
Photo "filename" was "status"
Photo "filename" was "status"
Photo "filename" was "status"
Etc....
i can get it to send an email per entry by using the following code.
<?
$get_info = ("select * from temp where email = '$email'");
$get_info_result = mysql_query($get_info) or die("Couldn't get image.");
{
if ($data = mysql_fetch_array($get_info_result)) {
do {
$msg = "Hi $data[name]\n\n";
$msg .= "We checked out your shot/s. See how they went below.\n";
$msg .= "-----------------------------------------------------------------------\n";
$msg .= "$data[orig_image_name] has been $data[status]\n";
$recipient = "<?echo $data[email] ?>";
$subject = "Rwy34.com photo status feedback.";
$mailheaders = "From: Rwy34.com uploads<> \n";
$mailheaders .= "Reply-To: admin@rwy34.com\n\n";
mail($recipient, $subject, $msg, $mailheaders);
} while ($data = mysql_fetch_array($get_info_result));
} else {
etc etc.........
?>
but what i actually want it to do is put all the info into the one email.
Im sorry for such a long post. Hopefully i have provided all the required information needed for someone to be able to assist me with this one.
Regards
Dave