|
-
Jun 8th, 2008, 12:21 PM
#1
Thread Starter
Addicted Member
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
-
Jun 9th, 2008, 04:02 AM
#2
Hyperactive Member
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.
-
Jun 10th, 2008, 08:25 AM
#3
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|