I have a loop, at one point in this loop i need to sum different amounts wich represent how much the project has been funded. my problem is for the first project the amounts are ok but for the next project, first project amount is added to second project.

The loop:

```
//money bar progress 1 (li_montant_recu=0 OR li_montant_recu=1) 
$p_one=$db->query("SELECT * FROM leve_invest WHERE (li_montant_recu=0 OR li_montant_recu=1) AND li_leve_id='".$l_r["l_id"]."'");

while($p_one_r=$p_one->fetch(PDO::FETCH_ASSOC)){
    $amount_p_one[]=$p_one_r["li_montant_hors_com"];
}

$p_one_sum=round((array_sum($amount_p_one) / $l_r["m_s"]) * 233);   

//money bar progress 2 (li_montant_recu=1) 
$p_two=$db->query("SELECT * FROM leve_invest WHERE li_montant_recu=1 AND li_leve_id='".$l_r["l_id"]."'");

while($p_two_r=$p_two->fetch(PDO::FETCH_ASSOC)){
    $amount_p_two[]=$p_two_r["li_montant_hors_com"];
}

$p_two_sum=round((array_sum($amount_p_two) / $l_r["m_s"]) * 233);

```

So `array $amount_p_one[]` and `$amount_p_two[]` keeps on adding amounts, what i need is to make those arrays variables.