PDA

View Full Version : Can someone help?


trackpads
06-06-2004, 04:28 AM
Hi,

I have a quiz on my site-

http://www.trackpads.com/quiz/

In the top of the page is the 'Top Test Takers' portion that I had a coder here make for me. The problem is that I dont like the listings in the way they are. Can someone tell me what to change the code to to make it just the 2 columns (Name and total # of quizzes taken) and then have it sort by total number of quizzes?

Thanks again if you can help,

-Jason




// Top 10





print "<table border=0 cellspacing=0 cellpadding=1 bgcolor=$table_border_color width=90% align=center><tr><td>\n";

print "<table border=0 cellspacing=1 cellpadding=1 width=100%>\n";

print "<tr>";

print "<td bgcolor=$table_color_1 width=100% colspan=4><font face=\"$font_face\" color=\"$font_color\" size=3><b>Top 10 Quiz Takers</b></font></td>";

print "</tr>";



print "<tr><td bgcolor=$table_color_2 width=30><font face=\"$font_face\" color=\"$font_color\" size=2><b>Rank </font></td>";

print "<td bgcolor=$table_color_2 width=50%><font face=\"$font_face\" color=\"$font_color\" size=2><b>Member Name</font></td>";

print "<td bgcolor=$table_color_2 width=50%><font face=\"$font_face\" color=\"$font_color\" size=2><b>Average Score</font></b></td>";

print "<td bgcolor=$table_color_2 width=30><font face=\"$font_face\" color=\"$font_color\" size=2><b>Quizzes Taken</font></b></td></tr>";



$toptip=$DB_site->query("SELECT username, userid, quizscore, quiztaken From user ORDER BY quizscore DESC");

while ($topinfo = $DB_site->fetch_array($toptip)){

if($topinfo[quiztaken]==0){

$av = $topinfo[quizscore];

}else{

$av = $topinfo[quizscore]/$topinfo[quiztaken];

}

$place++;

if($place<=10){

print "<tr><td bgcolor=$table_color_2 width=30><font face=\"$font_face\" color=\"$font_color\" size=2> $place </font></td>";

print "<td bgcolor=$table_color_2 width=50%><font face=\"$font_face\" color=\"$font_color\" size=2>$topinfo[username] </font></td>";

print "<td bgcolor=$table_color_2 width=50%><font face=\"$font_face\" color=\"$font_color\" size=2>$av </font></td>";

print "<td bgcolor=$table_color_2 width=30><font face=\"$font_face\" color=\"$font_color\" size=2>$topinfo[quiztaken]</font></td>";

print "</tr>";

}

}







print "</table>";

print "</table>";

print "<br>";

// End Top 10

trackpads
06-22-2004, 10:06 AM
Bump please!