0
我想計算平均運行時間totalscore/totalevaluatedcalls這是100.how我可以做到這一點與PHP ...和表後這裏是我的代碼。任何人都可以幫助我這方面,總計評估的調用是來自db的emp id的計數。如何獲得php的平均分數
empid agentname totalevaluatedcalls totalscore avaragescore
=========================================================================
1 xyz 2 200 100
total evaluatedcalls query
==========================
foreach($dbh->query("SELECT COUNT(*) as cnt FROM eval where empid=$empid") as $test) {
echo "<table ><tr ><td style='border: 0px; '>" . $test['cnt'] . "</td></tr></table>";
}
?>
total score query
==========================
foreach($dbh->query("SELECT SUM(totalscore) as cnt FROM eval where empid = $empid") as $leavecount) {
echo "<table ><tr ><td style='border: 0px; ' >" . $leavecount['cnt'] . "</td></tr></table>";
}
?>