Results 1 to 3 of 3

Thread: php mysql select random group results

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    175

    php mysql select random group results

    Hello all!
    im trying to make a page for my clã to ramdom select players for inside tournaments.

    my problem is how to query my player and map database and display the results in groups!

    player database:
    id
    name

    map database:
    id
    name

    i want to select all the players (so far so good)
    group them in 2 ramdom
    so they be in teams
    then select 2 teams and assign a random map

    anny ideas???
    thanks in advance

  2. #2
    Hyperactive Member
    Join Date
    Dec 2006
    Location
    Ubuntu Haters Club
    Posts
    405

    Re: php mysql select random group results

    Well there's 2 ways that you select 2 random groups, you can either do it in SQL itself or you can load ALL of the rows into PHP, then select 2 random offsets from the array you created with all the groups in it.

    Then you'd just repeat the process for the map and you could display what you have.

    Sorry if I haven't made myself clear but if you can't work it out I'll (try to) provide an example.
    » Twitter: @rudi_visser : Website: www.rudiv.se «

    If Apple fixes security flaws, they are heralded as proactive. If Microsoft fixes a security flaw, they finally got around to fixing their buggy OS.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    175

    Re: php mysql select random group results

    thanks for the awser! RudiVisser
    I now how to select random values
    may be i dindnt explain myself
    i need to select all players from player table,
    then put them in groups of 2
    then assign a random map for 2 groups

    annyways thanks

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