paulman888888 Posted January 1, 2009 Share Posted January 1, 2009 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 More sharing options...
Lautarox Posted January 1, 2009 Share Posted January 1, 2009 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 https://forums.phpfreaks.com/topic/139098-how-would-you-do-this/#findComment-727511 Share on other sites More sharing options...
paulman888888 Posted January 1, 2009 Author Share Posted January 1, 2009 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 https://forums.phpfreaks.com/topic/139098-how-would-you-do-this/#findComment-727518 Share on other sites More sharing options...
revraz Posted January 1, 2009 Share Posted January 1, 2009 So you want to use Round Robin type of tourney? Link to comment https://forums.phpfreaks.com/topic/139098-how-would-you-do-this/#findComment-727520 Share on other sites More sharing options...
paulman888888 Posted January 1, 2009 Author Share Posted January 1, 2009 if that is what it is called then yes. Thankyou revraz But that doesnt help me in makeing the script. Ill start Googleing things to see i find anything. Thankyou all the same Paul Hutchinson Link to comment https://forums.phpfreaks.com/topic/139098-how-would-you-do-this/#findComment-727641 Share on other sites More sharing options...
revraz Posted January 1, 2009 Share Posted January 1, 2009 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 https://forums.phpfreaks.com/topic/139098-how-would-you-do-this/#findComment-727663 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.