Loop issue

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Loop issue
Browser
CZ Super Newbie
 Codezwiz Site Donator
Browser has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Nov 14, 2004
0.01 posts per day
Posts: 48
Points: 5,631
   
The code below produces multiple lists and I need it to produce only one list with the scores added. Do I break out of the loop or is there some way to do this?


$result = mysql_query("select quizzId, quizzTitle, active, restrict_user, administrator,displayscore,nbscore from ${prefix}_quizz_admin where cid='$cid' order by timeStamp desc");
            while(list($qid, $quizzTitle,$active,$restrict_user,$administrator,$displayscore,$nbscore) = mysql_fetch_row($result))
            {
            # display the inactive quizz if admin
            if (is_admin($admin)  or ($administrator != "" and $cookie[1] == $administrator))
            {
                print "<tr><td>";

                  if ($displayscore)
                  {
                   $ress = mysql_query("SELECT username, SUM(score) as Total_score FROM ${prefix}_quizz_check group by username ORDER BY Total_score DESC,time DESC LIMIT $nbscore ");
                  
                  if (mysql_num_rows($ress)>0)
                  {
                  echo "";
                   while(list($username,$res) = mysql_fetch_row($ress))
                  {
                  print "<tr><td><font class=catdesc>$username ;; ;;</td><td><div align=right>$res</div></td></tr></font>";
                  }



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum