PHP double while loop, second loop is running only once
<p>I want to print information with the help of second while loop, but it is running only once.</p>

<pre><code>while($nextDate&lt;$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&gt;='".$weekDate."' and Deposit.DepositDate&lt;='".$nextDate."' group by Deposit.DepositNo 
                     order by Deposit.DepositNo desc";

        $connM=new dbconfig();
        $connM-&gt;connectdb();
        $connM-&gt;execute($qM);
        $amt=0;
        $damt=0;
        while($rowsM =$connM-&gt;fetch_row()) 
        {
            $amt=$amt+$rowsM['Amount'];
            $damt=$damt+$rowsM['DAmount'];
        }
}
</code></pre>
