Part of code looping twice

i have a code that send two emails to different people but the first mail sends the right total amount, while the message to the second email(los@yahoo.ca) adds up the total amount twice and sends it.please how can i fix it

  $body = "<html><body><table border='1'>
<tr>
<th>Shop Name</th>
<th>Product Name</th>
<th>Size</th>
<th>Color Name</th>
<th>Quantity</th>
<th>Price</th>
<th>Cost</th>
</tr>";
$totalPrice = 0;
$pplresult = mysql_query("SELECT * FROM repplac WHERE Uname = '{$_SESSION['username']}'");   
while($row = mysql_fetch_assoc($pplresult)){ 
    $body .= "<tr>
        <td>" . $row['Sname'] ."</td>
        <td>" . $row['Pname'] ."</td>
        <td>" . $row['Psize'] ."</td>
        <td>" . $row['Pcolour'] ."</td>
        <td>" . $row['Pquantity'] ."</td>
        <td>" . $row['Price'] ."</td>
        <td>" . $row['Tprice'] ."</td>
        </tr>";
         $totalPrices += $row['Tprice'];
}

     if(0.1*$totalPrices <= 50 )
    {
    $totalprice = (0.1*$totalPrices +  $totalPrices);
    }
    else
   {
    $totalprice = 50 + $totalPrices;
        }
$body .= "<tr>
			<td colspan=6>Total :</td> 
                       
            <td>" . $totalprice ."</td>
        </tr>";

$body .="</table></body></html>";

   //Send email
$to = $email; 
   $subject = "YOUR ORDER LIST($orderno) FROM REACHEASY"; 
 $headers = "From: donotreply@easy.co.uk\\r\
"
            . 'MIME-Version: 1.0' . "\\r\
"
            . 'Content-type: text/html; charset=iso-8859-1' . "\\r\
"
            . 'Bcc:notification@easy.co.uk' . "\\r\
";

mail($to,$subject,$body,$headers);

    //Get list to managers user
   $body = "<html><body><table border='1'>
<tr>
<th>Shop Name</th>
<th>Product Name</th>
<th>Size</th>
<th>Color Name</th>
<th>Quantity</th>
<th>weblink</th>
<th>info</th>
<th>Price</th>
<th>Cost</th>
</tr>";
$totalPrice = 0;
$pplresult = mysql_query("SELECT * FROM repplac WHERE Uname = '{$_SESSION['username']}'");   
while($row = mysql_fetch_assoc($pplresult)){ 
    $body .= "<tr>
        <td>" . $row['Sname'] ."</td>
        <td>" . $row['Pname'] ."</td>
        <td>" . $row['Psize'] ."</td>
        <td>" . $row['Pcolour'] ."</td>
        <td>" . $row['Pquantity'] ."</td>
        <td>" . $row['Weblink'] ."</td>
        <td>" . $row['comment'] ."</td>
        <td>" . $row['Price'] ."</td>
        <td>" . $row['Tprice'] ."</td>
        </tr>";
         $totalPrices += $row['Tprice'];
}
  if(0.1*$totalPrices <= 50 )
    {
    $totalprice = (0.1*$totalPrices +  $totalPrices);
    }
    else
   {
    $totalprice = 50 + $totalPrices;
        }
$body .= "<tr>
			<td colspan=8>Total :</td>      
            <td>" . $totalprice ."</td>
        </tr>";
$body .="</table></body></html>";

   //Send email
   $emails ="los@yahoo.ca";
$to = $emails; 
   $subject = "YOUR ORDER LIST($orderno) FROM REACHEASY"; 
 $headers = "From: donotreply@easy.co.uk\\r\
"
            . 'MIME-Version: 1.0' . "\\r\
"
            . 'Content-type: text/html; charset=iso-8859-1' . "\\r\
"
            . 'Bcc:notification@easy.co.uk' . "\\r\
";

mail($to,$subject,$body,$headers);


You reset $totalPrice but not $totalPrices;

You know you’re a C family programmer when you end a sentence with a semicolon instead of a period

Good catch btw =P

thanks for helping spot that

I have made enough of those types of errors so it was easy for me to spot.

Learn C back in the late 70s. This is the book I learned it from: