Originally posted by TheDefender
Give this a whirl...
$detailqry2 = "SELECT * FROM misc_order_detail, misc_order_items WHERE misc_order_detail.order_no = '".$order_no."' AND misc_order_items.id_no = '".$id_no."'";
[/B]
Thank you, that fixed the problem. But, now I have another problem. I am trying to send an e-mail, but it does not seem to want to work. Somewhere I have an error in my PHP code.
// send the mail
// recipients
$to = "Jeff Grossman <jeffg@turners.com>";
// subject
$subject = "Weekly Store Order";
// from
//From code snipped
// message
$message = '
<HTML>
<HEAD>
<TITLE>Weekly Store Order</TITLE>
</HEAD>
<BODY>
Weekly Store Order - Store: {$store}<BR><BR>
<TABLE>
<TR>
<TD width="250"><center><b><u>Description</u></b></center></TD>
<TD width="60"><center><b><u>VPC</u></b></center></TD>
<TD width="60"><center><b><u>Min</u></b></center></TD>
<TD width="60"><center><b><u>Max</u></b></center></TD>
<TD width="80"><center><b><u>Pkge Qty</u></b></center></TD>
<TD width="60"><center><b><u>Order</u></b></center></TD>
</TR>
';
foreach($order_qty as $id_no => $val) {
$detailqry2 = "SELECT * FROM misc_order_detail, misc_order_items WHERE misc_order_detail.order_no = '" .$order_no."' AND misc_order_items.id_no = '".$id_no."'";
mysql_query($detailqry2, $conn);
$message .= '
<TR>
<TD>{$description}</TD>
<TD>{$vpc}</TD>
<TD><center>{$min}</center></TD>
<TD><center>{$max}</center></TD>
<TD><center>{$package_qty}</center></TD>
<TD><center>{$order_qty2}</center></TD>
</TR>
';
//endwhile;
}
$message .= '
<TR>
<TD> </TD>
</TR>
<TR>
<TD colspan="6"><textarea rows="5" cols="80" name="comment" wrap>{$comment}</textarea></TD>
</TR>
</TABLE>
</BODY>
</HTML>
';
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* additional headers */
$headers .= "To: {$to}\r\n";
$headers .= "From: {$from}\r\n";
/* and now mail it */
mail($to, $subject, $message, $headers);
Thanks in advance for any help you can offer me.