can I have two while loops with same condition but different if statements in one page?
For instance:
$qtytoAdd = $rec_qty[$mat_key];
while($qtytoAdd > 0){
if(($remBalance - $qtytoAdd) >= 0) {
//do something
$qtytoAdd = 0
}else{
//do something
$qtytoAdd = $qtytoAdd - $remBalance
}
}
And something like this:
while($qtytoAdd > 0){
if(($reqRemBal- $qtytoAdd) >= 0) {
//do something
$qtytoAdd = 0
}else{
//do something
$qtytoAdd = $qtytoAdd - $reqRemBal
}
}
The $qtytoAdd
variable is actually defined at beginning before the loops. What I'm trying to do is run both while loops at the same time with both $qtytoAdd
of each while loops having the same values at first.