Team Creator Help o.O

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
NicEJoB
Forum Newbie
Posts: 14
Joined: Tue Jul 15, 2003 8:31 pm

Team Creator Help o.O

Post 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.
:?
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post 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.
NicEJoB
Forum Newbie
Posts: 14
Joined: Tue Jul 15, 2003 8:31 pm

Post 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
User avatar
Heavy
Forum Contributor
Posts: 478
Joined: Sun Sep 22, 2002 7:36 am
Location: Viksjöfors, Hälsingland, Sweden
Contact:

Post by Heavy »

Hmm... is SQLite available for PHP4?
If so, it might be the solution.
Post Reply