Jump to content

How would you do this?


paulman888888

Recommended Posts

hi;

 

I am trying to create a simple tournament script.

 

The amount of people who are in the tournamnt will change all the time so i cant use a fixed script.

 

I no i need to use lots of loops but i dont no where.

 

THIS IS THE PROBLEM!

how do the loops join together.

 

I think i need to do something like this;

 

Get the amount of player

Get the each name of a player and store in an array

Then am stuck...

Pair each one with another

then pair again but the same person

and so on untill all have played all!

 

Please Help me

Thankyou in advance

Paul Hutchinson

Link to comment
https://forums.phpfreaks.com/topic/139098-how-would-you-do-this/
Share on other sites

First of all you must use a database to store all you need..

For getting the ammount of players, you can do a mysql_num_rows() with a select sentence to get the number of players.

To get all the names and data of each player, you could select every player, and do a mysql_fetch_array(), about the pairing, you could create a table to store each game, the result and who played agains who, and with a select sentence you can get who played against someone and who didn't.

I think you'll need to learn a little about php first

I understand PHP quite well.

 

I no how to collect infomation from a database find rows and as such.

 

I want the output to be a list, (like below)

 

Round 1

Blah1 vs blah 2

blah 3 vs blah 4

 

Round 2

blah 1 vs blah 3

balh 2 vs blah 4

 

and so on untill all play all

 

Thankyou in advacne

Paul

I really has nothing to do with what I want to call it.  If you are going to run a tournament, then you should at least research the types there are, like Single Elimination, Double Elimination, Round Robin.  How can you run a site when you don't even know what type of tournament you are even running?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.