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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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