Jsut for infos sake, and the fact that Rudys code scares me ;-p

Here's what I ended up with...

============================
$sqlGetHighScore = "SELECT currentScore, nameFirst, nameLast, userId
FROM $tableUsers ORDER BY currentScore DESC";

while($rowGetHighScore = mysql_fetch_array($resultGetHighScore)) {
        
        // List ALL results, but only show the first 5 for top scorers
        if ($count <= 5) {
                $getHighScores .= "$rowGetHighScore[nameFirst]
$rowGetHighScore[nameLast]: $rowGetHighScore[currentScore]<br />\n";
        }
        

// Start list of last 5, ready to stop when you reach userId
        $filterList5 = $filterList4;
        $filterList4 = $filterList3;
        $filterList3 = $filterList2;
        $filterList2 = $filterList1;
        $filterList1 ="$count - $rowGetHighScore[nameFirst]
$rowGetHighScore[nameLast]: $rowGetHighScore[currentScore]<br />\n";
        
        if ($rowGetHighScore[userId] == "$_SESSION[userId]") {
                $showMyScore = "My Score: $rowGetHighScore[currentScore]";
                $masterFilterTop1 = "$count - 
<strong>$rowGetHighScore[nameFirst]
$rowGetHighScore[nameLast]: $rowGetHighScore[currentScore]</strong><br
/>\n";
                $masterFilterTop2 = $filterList2;
                $masterFilterTop3 = $filterList3;
                $masterFilterTop4 = $filterList4;
                $masterFilterTop5 = $filterList5;
                $count2 = 0;
        }
        
start count of next 5 users...
        if (($count2 <= 5) && ($count2 != 0)) {
                $masterFilterBottom .= "$count - $rowGetHighScore[nameFirst]
$rowGetHighScore[nameLast]: $rowGetHighScore[currentScore]<br />\n";
        }
        
        
        $count++;
        $count2++;
}

=============================

this query is used to make 3 seperate areas of data:
Your current score
the top 5 scorers
your place relative to all users...

it works great, with me and my 5 testers.. I wonder how it'll hold up
to several 1000 users... eek!

Tris...




On 18/12/06, Cheryl D Wise <[EMAIL PROTECTED]> wrote:
Yep, it is scary what someone who is really good can do in a very short time. To 
paraphrase, "I am awestruck, I bow in admiration."


Cheryl D Wise
MS MVP FrontPage
http://by-expression.com
Online instructor led training http://starttoweb.com
Now registering for our January 2007 session


-----Original Message-----
From: Tris

Wow..
i want to curl up and die..
That's insane!
What's more scary is that you probably looksed it for 1 minute and
knew what to do..
You're a clever clever man..
h you have been contacted with.


____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
      Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: unknown lmsubst tag argument: ''
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.


____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
      Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to $subst('List.Name') as: 
$subst('Recip.EmailAddr')
To unsubscribe send a blank email to $subst('Email.UnSub')
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to