MySQL Joins in the email body
CS5 / PHP / MySQL
I'm attempting to use data from a JOIN of two tables within the email body. I'm currently integrating data into the email body from recordsets just fine.
Here is the code. It will not show anything:
<?php
$neoArmenID = $row_rsSumm['ID'];
// Make a MySQL Connection
// Construct our join query
$query = "SELECT neoOrderDetails.*, neoStoryMain.* ".
"FROM neoOrderDetails, neoStoryMain ".
"WHERE neoOrderDetails.orderID = $neoArmenID AND neoStoryMain.ID = neoOrderDetails.mainProgram";
$result = mysql_query($query) or die(mysql_error());
// Print out the contents of each row
echo "Program(s): ";
while($row = mysql_fetch_array($result)){
echo $row['mainStory'];
echo ", ";
}
?>
The code works fine when placed in an independent file and executed. However, as part of the email body (edited in DW CS5), it produces nothing.