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:
Code:
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.