how to used while in while loop fetch array count sum php mysql

Description

How to used while in while loop to fetch mysql data While Loop Inside a While Loop used in php PHP While Loop Tutorial . fetch mysql data with while loop in php fetch data in mysql data base foe two table with while in while loop used and display information in php

How to used while in while loop to fetch mysql data

$summgbtamain = 0;

<td>

<?php

$summgbta=0;

$techwiteachtechdda = mysql_query("SELECT * FROM mgbattadd where rmidlist = '".$selectroomid."' ");

// $techwiseteachersbr = mysql_fetch_array($techwiteachtechdda);

// $managebatchida = $techwiseteachersbr['managebatchid'];

while($techwicddersbr=mysql_fetch_array($techwiteachtechdda)){       

$managelist = $techwicddersbr['managid'];

$techwicddda = mysql_query("SELECT * FROM manhlist where batcode = '".$managelist."' ");

$checknonn = mysql_num_rows($techwicddda);

echo $checknonn;

$summgbta = $summgbta + $checknonn;

while($techwicddersbra=mysql_fetch_array($techwicddda)){

//$techwicddersbr = mysql_fetch_array($techwicddda);

//    echo '<div style="border:1px solid;">';  

// $summgbta = $summgbta + $checknonn;

//echo $summgbta;

//echo $techwicddersbra['adminid'];

//echo $techwicddersbra['batchcode'];

// echo '</div>';

}  

}

echo $summgbta;

$summgbtamain =  $summgbtamain + $summgbta;

?>

 

</td>