I'm having problems sending an email that includes multiple rows from a database query. When I use the code below, only the first row of results gets sent.
I've tried a number of things to get ALL the results to show up in the email, but have had no luck.
Can anyone give me a hint?
$sql="SELECT * FROM Cart WHERE SessionID='$SessionID'";
$result = DoQuery($sql);
while ($row = mysql_fetch_array($result)) {
extract($row);
$cartcontents="<TR><TD>$Code</td><TD>$Option1<BR>$Option2 $Option3 $Option4</td><TD>$Name</td><TD>$Quantity</td><TD>$UnitPrice</td>\
</tr>";
}
$cartbottom="</table>";
$body= $carttop . $cartcontents . $cartbottom. $emailinfo;
mail("$toemail", "$subject", $body,
"From: $email", "-f$email");