<html>
<head>
   <title>Averages per conference</title>
</head>
<body bgcolor="#FFFFFF">

<center><table BORDER=3 CELLSPACING=3 CELLPADDING=4 COLS=2 WIDTH="90%" BGCOLOR="#FFFFFF" BORDERCOLOR="red" >


<?php


   $db=mysql_connect("janus","w_apers","peru");
     mysql_select_db("conferenties");

     $result=mysql_query ("select sum(accepted)/sum(submitted) as ratio, stats.conf_id, conf_name
                           from conf, stats
                           where conf.conf_id=stats.conf_id
                           group by stats.conf_id
                           order by ratio asc",$db);

?>

<tr ALIGN=CENTER VALIGN=CENTER BORDERCOLOR="red">
<th> Conference</th>
<th>Average acceptance rate</th>
</tr>
<?php

while ($row=mysql_fetch_row ($result)){
   echo "<tr ALIGN=CENTER VALIGN=CENTER>\n";
   echo "<th><a href='conf.php3?conf_name=$row[2]&conf_id=$row[1]' target='confright'>",
         $row[2],"</a></th><td>",round($row[0]*100),"%</td></tr>\n";
}
mysql_close($db);
?>
</table>
</center>
</body>
</html>

