I have two separate query on my PHP mailer and I wonder how can it be possible to call the two queries in one fetch array.
I know this won't work :) any suggestion how to call two queries?
Code:
#email process starts here
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->From = "xxxx";
$mail->FromName = "administrator";
$mail->Subject = "xxxx";
$mail->Host = "xx.xx.xx.x"; // SMTP server
$mail->Mailer = "smtp";
//$query
$query ="SELECT * FROM members";
$query1 ="SELECT max(fileid) FROM table1";
$result=@MYSQL_QUERY($query);
$result1=@MYSQL_QUERY($query1);
while ($row = mysql_fetch_array ($result, $result1)) {
// HTML body
$body = "Hello <font size=\"4\">" . $row["fname"] . "</font>, <p>";
$body .= " <font size=\"4\"> A document is now available for your review" . $row["fileid"] ."</font><p>";
$body .= "http://xx.xx.xx.xxx/data.php?id=\" .$row [fileid] .\"<p>";
$body .= "Thank You, <br>";
$body .= "Administrator";
$mail->Body = $body;
$mail->AltBody = $text_body;
$mail->AddAddress($row["email"], $row["fname"]);
if(!$mail->Send())
echo "There has been a mail error sending to " . $row["email"] . "<br>";
// Clear all addresses and attachments for next loop
$mail->ClearAddresses();
$mail->ClearAttachments();
}
Comment