Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 7 of 7 FirstFirst ... 567
Results 91 to 92 of 92
  1. #91
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,947 Times in 4,908 Posts
    I see you have an id field. Presumably that is the id of the user who filled out the bracket, yes? That is, it is a foreign key to your Users or Members table?

    So your tables should look like this:
    CREATE TABLE members ( /* or name of your choosing */
        memberId INT PRIMARY KEY,
        memberName varchar(...),
        ...other fields describing the member...
    CREATE TABLE teams (
        teamId INT PRIMARY KEY,
        teamName varchar(100),
        seeding INT /* optional */
    CREATE TABLE picks (
        memberId INT REFERENCES members(memerId),
        bracketSlot varchar(10),
        int teamId REFERENCES teams(teamId) 
    In other words, each pick by each person gets a *separate record*.

    And now the PHP code to insert into that table is trivial:

    You simply loop through all the fields in the POST that start with "pick" and insert them, along with the member's id and the team he/she picked, into one record in the PICKS table.
    Be yourself. No one else is as qualified.

  2. Users who have thanked Old Pedant for this post:

    andrewkcohen (12-04-2011)

  3. #92
    New to the CF scene
    Join Date
    Mar 2012
    Thanked 0 Times in 0 Posts


    Did anyone have a good solution to this? It looks like there were some good ideas, did anyone ever finish it?

Page 7 of 7 FirstFirst ... 567

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts