Form fields and MySQL column name Association


#1

Im having trouble with a sports site im creating for a client of mine.
The part is where the Team Captians for each team in the league go into
the admin section to submit a match report for each match. The form
looks like this:

TEAM 1 BATTING: (these are all drop down menus that pull the player
names from the database)
There are 10 of these rows that look like this, 1 row for each player.
|-Batter-| |-Balls-| |-Minutes-| |-How Out-| |-Fielder-| |-Pitcher-| |-Runs-|

After they fill out this form, it has to submit all 10 rows into a
database table. The thing is, the column names in the table dont
associate with the form names…

I’ve tried something like:

@params = params[:playerclubseason]
@playermatchdata = Playermatchdata.new
@playermatchdata.PlayerID = @params[:HBTbatsman1]
@params = params[:playerclubseason]
etc…

But i keep getting nil for HBTbatsman, even though there is a value.

Is their anyway else to go about getting form fields to insert into
database columns with different names?

Any Help is much appreciated!