Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Insert Multiple Records
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Insert Multiple Records

 Post Reply Post Reply
Author
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2003 at 6:45pm
Hmm ... now I think I get what you meant. Thanks.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.