<?php include("./inc_common.php"); require_once($data_path.'quiz/config.php'); if (mysql_connect($quiz_config['db_server'], $quiz_config['db_user'], $quiz_config['db_pass'], $quiz_config['mysql_encoding']) && mysql_select_db($quiz_config['db_name'])) { mysql_query('SET NAMES '.$quiz_config['mysql_encoding']); $q_top3 = mysql_query("SELECT * FROM `voc3_quiz_full_stat` ORDER BY `cnt` DESC LIMIT 10"); $top3_r = mysql_fetch_assoc($q_top3); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <? for ($i = 0; $i < count($top); $i++) { ?> <table border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td valign="middle" width="15"><b><?=($i+1);?></b></td> <td valign="middle" width="60"><b><?=$top[$i]['user_name'];?></b></td> <td valign="middle" width="60"><b><?=$top[$i]['cnt'];?></b></td> </tr> </table> <? } ?> <?php }?>
<?php include("inc_common.php"); require_once($data_path . 'quiz/config.php'); if (mysql_connect($quiz_config['db_server'], $quiz_config['db_user'], $quiz_config['db_pass'], $quiz_config['mysql_encoding']) && mysql_select_db($quiz_config['db_name'])) { mysql_query('SET NAMES ' . $quiz_config['mysql_encoding']); if (mysql_select_db($quiz_config['db_name'])) { $sql = "SELECT * FROM `{$quiz_config['db_prefix']}quiz_full_stat` ORDER BY `cnt` DESC LIMIT 10"; $res = mysql_query($sql); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <? $i = 1; while ($top = mysql_fetch_assoc($res)) { ?> <table border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td valign="middle" width="15"><b><?= ($i++); ?></b></td> <td valign="middle" width="60"><b><?= $top['user_name']; ?></b></td> <td valign="middle" width="60"><b><?= $top['cnt']; ?></b></td> </tr> </table> <? } } }