stockdalep Posted April 20, 2007 Share Posted April 20, 2007 Hi I have a while loop that just prints outsome values from a database like this I need to put this into an email. I know the basics of php mail but cannot figure out how to get this into the body of the email. Thaks for any help. while($row = @mysql_fetch_array($order)) { // Increment the total cost of all items $totalCost += ($row["qty"] * $row["itemPrice"]); ?> <tr> <td width="15%" height="25"> <font face="verdana" size="1" color="black"> <?php echo $row["qty"]; ?> </font> </td> <td width="55%" height="25"> <b><font face="verdana" size="1" color="black"> <?php echo $row["itemName"]; ?> </font> </td> <td width="20%" height="25"> <b><font face="verdana" size="1" color="black"> £<?php echo number_format($row["itemPrice"], 2, ".", ","); ?> </font> </td> <td width="10%" height="25"> </td> </tr> <?php } // Display the total ?> <tr> <td width="100%" colspan="4"> <hr size="2" color="#FF6600" NOSHADE> </td> </tr> <tr> <td width="70%" colspan="2"> <td width="30%" colspan="2"> <font face="verdana" size="2" color="black"> <b>Total: £<?php echo number_format($totalCost, 2, ".", ","); ?></b> <p> Link to comment https://forums.phpfreaks.com/topic/47928-loop-and-email/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.