Olympic Games Medal Tally


'.$country_name.''; } $gold = $silver = $bronze= 0; $sqlStmt = "SELECT *FROM ".TBL_OLYMPICS_MEDAL." WHERE country = '".$country_id."'"; $tempQ = mysql_query($sqlStmt); if(mysql_num_rows($tempQ)>0) { while($tempR = mysql_fetch_object($tempQ)) { $medal = $tempR->medal; if(strtolower($medal) == "gold") $gold++; elseif(strtolower($medal) == "silver") $silver++; elseif(strtolower($medal) == "bronze") $bronze++; } $total = $gold + $silver + $bronze; $tot_gold += $gold; $tot_silver += $silver; $tot_bronze += $bronze; ?>
S#
Country
Code
Gold Silver Bronze Total
Total