you need to use array if you want to store more than one value into the same variable
the exemple i gave you in the other post was constructing the $info right in the loop.
session_start();
$info='';
$sql="SELECT * FROM order_line WHERE order_ID='$tran_ID'";
$mysql_result=mysql_query($sql,$connection);
$num_rows=@mysql_num_rows($mysql_result);
$i=0;
while ($row=mysql_fetch_array($mysql_result))
{
$system_type=$row["system_type"];
# display results
$ID[$i]=$row["ID"];
$item[$i]=$row["item"];
$qty[$i]=$row["qty"];
$price[$i++]=$row["price"];
}
$to="me@me";
$from_email="Order Enquiry";
$header="Internal Stationary Order";
for($j=0;$j<$i;$j++) {
$info.="An order has been placed. Product code=.$price[$j]. Product=$item[$j] Quantity=$qty[$j]
The order ID is $tran_ID.\n";
}
mail($to,$header,$info);
echo "Thank-you for your product enquiry.
For your information your Order/Transaction ID is $tran_ID. <BR>";
echo nl2br($info);
mysql_close($connection);
session_unset();
session_destroy();
i droped one line in the while :
$tran_ID[$i]=$row["order_ID"];
this row is no use as you already know $tran_ID (used in your query), so drop it
i prefer the other method which constructed the lines so it was better presented in the mail. but this exemple will work also
the echo nl2br($info) will be changed to mail($info) instead.
in mail \n is the newline, not in html.