The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

My difficulty is how do I deal with the values coming in when the page is submitted. I've tried doing a foreach loop on the $_GET array for all values but cant seem to figure out how I a group each teams goal prediction with the relevant fixture id
i.e. something like insert into prediction userid,fixid,team1goals, team2goals where fixid = 1 and loop this for, say, 10 fixtures....

What would be the best approach for grouping the variables so I can achieve this ?

Should I change my original form ? Can I incorporate the fixtures array in the hidden field ? Can I group or make an array from the values in the $_GET array ? so many questions!

As for the sql, again due to me not understanding what you're doing, I'm not really sure. Are there more than 2 different teams(like...football teams?) How would you know which team is team 1, and which is team 2? Is that info related to fixid?

Thanks for the reply and I think you may be on to something here....I've been looking at this for a couple of days and i think its prob a simple answer but just needs fresh eyes, and yes it is exactly a football teams prediction league.

My prediction league system allows users to log in and predict scores between two teams in many rounds of fixtures/games. These predictions are logged and compared against the actual results of the games, points awarded, and the user table is then updated to display the user with the most points.

So I've got 10 teams and they each play each other once. I've got a table for Users, Teams, Fixtures, Predicitions and Results. They are related in that

Teams have TeamID,TeamName,

Fixtures have FixID,Fix_Team1,Fix_Team2,Round

Fixtures.Fix_Team1 = Teams.TeamID
Fixtures.Fix_Team2 = Teams.TeamID

For Round 1 of fixtures I've got
Team 1 vs Team 2....to Team 9 vs Team 10
My HTML form will display a form containing the 5 Fixtures of round 1
The user will see a form with 5 fixtures(games) and they will enter goals for Team 1 vs Team 2 up to goals between Team 9 vs Team 10

The form is submitted once for this round of fixtures. The data submitted will contain 5 different fixture id's and 5 predicitons like below with 10 user inputted values for the goals column.