Hi Again all,
OK, figured out the last problem, now onto this final one.
The following bit of code displays the correct results on the page. No Problems there.
<?
$get_info = ("select * from processed order by email");
$get_info_result = mysql_query($get_info) or die("Couldn't get image.");
{
if ($data = mysql_fetch_array($get_info_result)) {
do {
print "<FONT SIZE=\"2\" FACE=\"ARIAL\" color=\"white\"><a href=\"procbatch.php?email=$data[email]\">$data[email]</a></font><br>\n";
} while ($data = mysql_fetch_array($get_info_result));
} else {
print "<center>\n";
print "<FONT SIZE=\"2\" FACE=\"ARIAL\" color=\"white\">Empty Set</font>\n";
print "</center>\n";
}
}
?>
Now the below code as far as i can see it is pretty much the same only it emails the results rather than places them on the screen. Only problem with this one is, it ALWAYS misses 1 record.
If i have 10 records in the table, it will send me an email with 9. If i have 5 records in the table it will send me an email with 4 and so on.
<?
$get_info = ("select * from processed");
$get_info_result = mysql_query($get_info) or die("Couldn't get image.");
if ($data = mysql_fetch_array($get_info_result)) {
$recipient = "$email"; // email address from query
$subject = "photo status feedback.";
$mailheaders = "From: photo uploads<> \n";
$mailheaders .= "Reply-To: admin@rwy34.com\n\n";
$msg = "Hi\n\n";
$msg .= "Thanks for uploading your photos.\n\n";
$msg .= "We checked them out and this is how they went.......\n\n";
while ($data = mysql_fetch_array($get_info_result))
{
$msg .= "Your photo of $data[rego] with filename $data[orig_image_name] has been $data[status]\n";
}
$msg .= "\nOnce again, thankyou for your uploads.\n\n";
mail($recipient, $subject, $msg, $mailheaders);
} else {
print "<center>\n";
print "<FONT SIZE=\"2\" FACE=\"ARIAL\" color=\"white\">The table is empty</font>";
print "</center>\n";
}
?>
If anyone should shed some light on why this last piece of code might be missing 1 record every time I would greatly appreciate it.
The record it is missing always seems to be the first one in the table.
Regards and Thanks
Dave