rockinaway Posted May 30, 2011 Share Posted May 30, 2011 Basically I am setting up my own cricket management game, but there are 3 areas that I am slightly stuck on and would appreciate help: 1) When a use registers, I need to create 11 players for their team. For this, I am going to have one text files with first names and one text file with surnames. How can I open each file and select a name and then match them together? 2) I need to create the list of games to be executed at particular times through a cron job. How can I go through all the teams in a table and match them together in games, ensuring everyone plays everyone? If a new player registers, he will be put into a random league and so the games for that league will have to be redone 3) How can I set up a cron job to execute the above games? Each team should play once a day and so if there are 24 teams in a table, there will be 12 games that occur through this cron job. I assume cron jobs are the best thing for this. Any help would be appreciated. Thanks. Link to comment https://forums.phpfreaks.com/topic/237847-generate-names-random-ordered-games-and-cron-jobs-3-questions/ Share on other sites More sharing options...
rockinaway Posted May 30, 2011 Author Share Posted May 30, 2011 Any help? Link to comment https://forums.phpfreaks.com/topic/237847-generate-names-random-ordered-games-and-cron-jobs-3-questions/#findComment-1222507 Share on other sites More sharing options...
plznty Posted May 30, 2011 Share Posted May 30, 2011 For number 1 I would recommend a database column for each first and surname and then mix in a mysql rand, else have 2 notepad files and select a line at random. For the rest you are going to have to use your imagination, this isn't programming theory help. Link to comment https://forums.phpfreaks.com/topic/237847-generate-names-random-ordered-games-and-cron-jobs-3-questions/#findComment-1222621 Share on other sites More sharing options...
rockinaway Posted May 31, 2011 Author Share Posted May 31, 2011 Hmm that will be one GIANT database if I was to have thousands of names! haha, but it is an option. Well I need to do further reading into cron jobs to figure out how to use them properly.. rather confusing! Link to comment https://forums.phpfreaks.com/topic/237847-generate-names-random-ordered-games-and-cron-jobs-3-questions/#findComment-1222779 Share on other sites More sharing options...
Ollifi Posted May 31, 2011 Share Posted May 31, 2011 There may be some feature in your host control panel about cron. In my host there is a feature what will automatically create cron job based entered information. Maybe you can found it as well in your host´s controlpanel? Link to comment https://forums.phpfreaks.com/topic/237847-generate-names-random-ordered-games-and-cron-jobs-3-questions/#findComment-1222828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.