如果我有两个循环,我想知道如何计算结果!:
$select = "SELECT X FROM Y"
$result = mysql_query($select,$link);
$total = mysql_num_rows($result);
while($row = mysql_fetch_array($result)) {
$Name = $row['X'];
$select2 = "SELECT id FROM `".$Name."` ";
$result2 = mysql_query($select2,$link) or die ('Erreur : '.mysql_error() );
$total2 = mysql_num_rows($result2);
while($row2 = mysql_fetch_array($result2)) { echo $row2['id']} }
我想数一数我最后有多少 id 。谢谢你的帮助