Page 1 of 1

Team Creator Help o.O

Posted: Tue Jul 15, 2003 8:31 pm
by NicEJoB
I am trying to create a team creator in PHP...
A user will type in thier name, and click a "submit" button and have it stored somewhere, up to 24 people will do this. I would like it so only 24 names can be submitted, and if another name is submitted have some type of message to appear saying "theres too many names" or something to that effect. After I want the script to take the 24 names and randomize them into 8 different groups of 3. Any help would be greatly appreciated.
:?

Posted: Tue Jul 15, 2003 10:17 pm
by DuFF
Not too hard, if you are using a MySQL database. To solve the problem with a max of 24 users I would use an unique/auto_increment ID for each of the names. That way if the ID is > 24 then you output the error message. For the random part I would look into the rand() function. Make your own little function that will go through and pick 3 random numbers each time but make sure to remember which ones are already being used. Post if you need more help.

Posted: Tue Jul 15, 2003 10:42 pm
by NicEJoB
I dont use MySQL that much, although i do have a MySQL database so i wouldnt have a clue how to go abouit that route

Posted: Wed Jul 16, 2003 12:19 pm
by Heavy
Hmm... is SQLite available for PHP4?
If so, it might be the solution.