first of all im a noob when it comes to coding but il try to explain im trying to send email with all the products from Cart table to a customer, but all I can send is the last row of the cart table, when im echoing the var's it prints to me all the products I need.
$message ="";
$message2 ="";
$trxformail = "select * from orders where trx_id = '$trx_id'";
$run_trx = mysqli_query($con, $trxformail);
while($post_trx = mysqli_fetch_array($run_trx)){
$pro_id = $post_trx['p_id'];
$pro_price = "select * from products where product_id='$pro_id'";
$run_pro_price = mysqli_query($con,$pro_price);
while($pp_price = mysqli_fetch_array($run_pro_price)){
$product_price = array($pp_price['product_price']);
$product_id = $pp_price['product_id'];
$qty = $pp_price['product_qty'];
$pro_name = $pp_price['product_title'];
$pro_makat = $pp_price['product_makat'];
$values = array_sum($product_price);
$total +=$values*$p_price['qty'];
$headers = "MIME-Version: 1.0" . "
";
$headers .= "Content-type:text/html;charset=UTF-8" . "
";
$headers .= 'From: <blah@blah.com>' . "
";
$subject = "פרטי ההזמנה שלכם באתר 'סלינה'";
echo $pro_name;
echo $qty;
$message .= "<html>
<p dir='rtl'>
שלום רב, <b style='color:#cc00cc;'>$c_name</b>, אנו מודים לכם על שקניתם אצלינו, ההזמנה שלכם תטופל בהקדם האפשרי.
</p>
<table width='600' align='center' bgcolor='white' border='1' dir='rtl'>
<tr align='center'><td colspan='6'><h2>פרטי ההזמנה שלכם</h2></td></tr>
<tr align='center'>
<th><b>מ.מ</b></th>
<th><b>שם המוצר</b></th>
<th><b>כמות</b></th>
<th><b>שולם</th></th>
<th>מספר ההזמנה</th>
</tr>
<tr align='center'>
<td>1</td>
<td>" . $pro_name . "</td>
<td>" . $qty . "</td>
<td>$total</td>
<td>$invoice</td>
</tr>
</table>
</html>";
}