Originally posted by paulnaj
Why not the simpler ...
$ordered = "";
while ($row_order = mysql_fetch_assoc($order)){
$ordered .= "<p>".$row_order['title']."</p>";
}
[/B]
That works fine, and doesn't give me any errors, but by the time I insert the $ordered variable into the email, it has looped through all the results, so only the last result (row) appears in the email. If I try and insert the loop into the email message like this:
$message = "the text before I want to insert the loop.
Order No: $order_id
Titles Ordered: ".while ($row_order = mysql_fetch_assoc($order)){
$ordered .= "<p>".$row_order['title']."</p>";
}
."Total Cost: £$booktotal
Rest of email message, blah, blah";
..it just gives an error for the 'Titles ordered:' line. I think I'm doing something badly wrong when I insert the php statement into the email, I just don't know what it is!
Thanks for your help so far, anymore would be greatly appreciated!🙂