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
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.
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