| Author |
Topic Search Topic Options
|
ngaisteve1
Groupie
Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
|
Post Options
Thanks(0)
Quote Reply
Topic: Insert Multiple Records Posted: 09 November 2003 at 9:52pm |
I wonder I ask this before. But, the problem I am facing right now is insert / save multiple records. (View - http://www.htmlforums.com/attachment.php?s=&postid=19663 3). I don't any problem to delete multiple records. For deletion multiple records, I use the checkbox and then the process file, I use Select IN. But, for insert / save multiple records, the problem I thought of is the field name. The quantity textbox name is not fix (dynamic). And these dynamic textbox name is going to save to that id. I got stuck here. I have done a little research. Most of them is update multile not insert multiple. I guess update multiple is a litte easier because the number of records is fix, thus make the for loop easier.
Any idea to my problems? Any good tutorial or sample regarding this situation? Thank you everyone in advance.
|
 |
ljamal
Mod Builder Group
Joined: 16 April 2003
Status: Offline
Points: 888
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 November 2003 at 7:47am |
|
To do an insert multiple, you need a force the user into a set number and/or let them pick a set number. (see the poll creation in this forum)
Then you create a form with all the fields for each record. I usually name things logically so if I have 7 rows of 3 columns, they would be 1-1, 1-2, 1-3, 2-1, 2-3, 2-4, etc.
Since you know how many rows are supposed to have you can loop through and get the information and create a insert statement for each row of data.
|
|
|
 |
ngaisteve1
Groupie
Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 November 2003 at 6:18pm |
|
But, what u mean would be a fix loop or dynamic loop? Means, if fix loop, if got ten records, I fill in 3, the process file will loop ten records. While dynamic loop is, if got ten records, I fill in 3, it will loop 3 only.
|
 |
ljamal
Mod Builder Group
Joined: 16 April 2003
Status: Offline
Points: 888
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 November 2003 at 6:24pm |
|
What I suggested is a dynamic fixed loop, if that makes any sense. It's dynamic in that the user decides the # of rows, but fixed in that you know how many rows to display on the page and look for later.
A truly dynamic solution could allow you to add one at a time until you are finished or even multiple at a time until you are finished.
|
|
|
 |
ngaisteve1
Groupie
Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 November 2003 at 6:45pm |
|
Hmm ... now I think I get what you meant. Thanks.
|
 |