Inserting form fields to database
Hi All,
I am stuck in a situation wherein i am given to design a form(financial year) which contains many unique fields.I want to know how do i insert these many fields to database as using prepared statement would mean my Insert statement would go endless(as the fields are 60).The form pattern is i have months vertically arranged and 5 headers (horizontally arranged).Also an option of using an array wont work since all the fields are unique..
Any help would be highly appreciated.
Thanks in advance
Re: Inserting form fields to database
Quote:
Originally Posted by
satish87
Hi All,
I am stuck in a situation wherein i am given to design a form(financial year) which contains many unique fields.I want to know how do i insert these many fields to database as using prepared statement would mean my Insert statement would go endless(as the fields are 60).The form pattern is i have months vertically arranged and 5 headers (horizontally arranged).Also an option of using an array wont work since all the fields are unique..
Any help would be highly appreciated.
Thanks in advance
I don't understand, are you saying that you have a table in your database with 60 columns? If so, might be time to rethink the design. If not, you might want to provide a bit more detail.
Re: Inserting form fields to database
Presumably the form represents a financial year (you seem to have 12 months on it).
So (in my mind) you have 12 rows to insert, one for each month, each containing 5 fields.
Which is a going to be a batched PreparedStatement as, presumably, you do not want a partial commit.