0
我有2個數組使用2 while循環來自數據庫。數組減法和賦值數組值
while($row2 = mysql_fetch_assoc($result2))
{
$surveyscnt[$row2['user_grp_id']]=$row2['COUNT(*)'];
}
while($row3 = mysql_fetch_assoc($result3))
{
$ndhcnt[$row3['group_id']]=$row3['headcount'];
}
任何人都可以指導我怎麼做foreach循環內以下
請參考下面
foreach($surveyscnt as $node => $headcount){
if($ndhcnt[$node]!=$headcount){
$pIdsNself = getAllParentsNself(array(**NEED TO CALL group_id**));
updateRollups($pIdsNself,**NEED TO PUT THE DIFFERENCE of(COUNT*-headcount)**);
}
}
foreach循環任何形式的幫助表示讚賞
謝謝男人:)但不是$總人數,我需要把$ surveyscnt [$ node] – Justin 2013-03-07 05:38:59