...

View Full Version : Few problems with PHP.



xGIHavoc
01-06-2006, 02:10 PM
Well, I'm new here, looks great around here and was wondering if you guys could help me with my script.

I am making a league script and have been doing good but there is a few things that I lack at with PHP and don't know how to do.

I have a teams table and want to make some code that will make each team have an opposing team to play them, but cannot assign matches to teams that already have a match that week. For each match, I want the leader of the team to report the match and only them. How could I do this? Any help would be greatly appreciated. :)

Rich Pedley
01-06-2006, 03:02 PM
But surely you also need to ensure that the following week has the same team playing a different team? and in turn not playing them again(well Home and Away matches aside) in the same season?

A couple of years ago my very first php project was creating a set of scripts to run a chess league, I doon't know whether anyone ever used it though.

However the files are still available via Quirm.net (http://www.quirm.net/) and if you look in the files, the auto-matches.php contains the code. This traverses the db table and created a whole season of matches for each team in the relevant division. The math involved was fairly complex...

Be warned however that the code is horrible, but it was my first project.

xGIHavoc
01-06-2006, 04:01 PM
But surely you also need to ensure that the following week has the same team playing a different team? and in turn not playing them again(well Home and Away matches aside) in the same season?
Ya, and thanks for a script reference. Code is a little messy to know what parts do what though lol. :cool:

Rich Pedley
01-06-2006, 09:37 PM
told you it was my first script :-)

xGIHavoc
01-06-2006, 10:17 PM
lol, how does the script work? Like how many weeks, the actual random match generating and all that stuff.

Rich Pedley
01-06-2006, 10:31 PM
from memory, it takes a value from the config which sets how long in weeks between the matches.

the actual generating is so complicated math wise I doubt I could explain it! hmm maybe it would have been better if i hadn't said anything :grin:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum