dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [help]newbie msql sorting question

  1. #1
    Half Empty happinessSam's Avatar
    Join Date
    May 2003
    Location
    London
    Posts
    442

    [help]newbie msql sorting question

    I've been trying to learn some php and msql, I've been reading through and doing various tutorial. I've got to the point where I can send variable from Flash, store them in a database, then call them back again. I decided as a project to make some high score tables for some of my games (no problems so far). What I want to do now is to make it so after ordering the table by score I want to be able to call a specific range of rankings, e.g the score and users ranked 120-130.
    From the tutorials I've been doing the only way I can see of doing this is to sort the tables by score, set up a for loop going through the rows then only print back when $i is in the right range (120-130, say). This works, but it seems really inefficient. Is there a better way to do this? What would the big game sites, who might have hundreds of thousands of rows in their highscore tables do?

  2. #2
    __OSX powered__ nucleuz's Avatar
    Join Date
    Aug 2000
    Location
    Norway
    Posts
    836
    use a LIMIT query:
    PHP Code:
    LIMIT 12010
    that will get you all results between 120 and 130
    NuCleuZ :: PHPVolcano :: Blog

  3. #3
    Half Empty happinessSam's Avatar
    Join Date
    May 2003
    Location
    London
    Posts
    442
    Thanks a lot.
    Another follow up question:- If after adding a new score to the table I then want to return that score with the rank it has, is there a quick way of doing that?

    So far I've just been going through a book by friends of Ed called 'Flash MX Application' and I've been looking at w3schools.com as well. They're both good, but pretty basic. Can you recommend any other tutorial sites? (I tried putting 'tutorial' and 'msql' into google and it spat back some many results I don't know where to start).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center