2 番目の while ループを使用して情報を出力したいのですが、実行は 1 回だけです。
while($nextDate<$currentDate)
{
$nextDate=date('Y-m-d',strtotime('+ 6 days',strtotime($weekDate)));
$qM="select count(*) as count ,Deposit.DepositNo, Deposit.DepositDate,
sum(DepositItem.Amount) as Amount,DAmount
from DepositItem
inner join Deposit on Deposit.DepositNo=DepositItem.DepositNo
where Deposit.DepositDate>='".$weekDate."' and Deposit.DepositDate<='".$nextDate."' group by Deposit.DepositNo
order by Deposit.DepositNo desc";
$connM=new dbconfig();
$connM->connectdb();
$connM->execute($qM);
$amt=0;
$damt=0;
while($rowsM =$connM->fetch_row())
{
$amt=$amt+$rowsM['Amount'];
$damt=$damt+$rowsM['DAmount'];
}
}