you can use this:
<input name="name1"
<input name="name2"
<input name="name3"
etc...
<input type="hidden" name="fields" value="3"
and then
<cfloop from="1" to="#form.fields#" index="i">
<cfquery code here>
insert into names (name) values (#evaluate('form.name' & i))
</cfquery ends here>
----- Original Message -----
From: "mayo" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, July 09, 2003 2:55 AM
Subject: insert multiple records into multiple tables
> I've gotten myself completely lost.
>
> I have a form in which I would like to insert multiple records into
multiple
> tables. The trouble comes in grabbing the record IDs from one table and
> inserting them in the other.
>
> Currently I insert one record at a time. What I would like to do is to be
> able to insert multiple items at one time and am going nowhere fast.
>
>
> INSERT into table1
> (
> 'A',
> 'B',
> 'C'
> )
> VALUES
> (
> '#FORM.A#',
> '#FORM.B#',
> '#FORM.C#'
> )
>
>
> INSERT into table2
> (
> 'D',
> 'E',
> 'F'
> )
> VALUES
> (
> '#FORM.D#',
> '#FORM.E#',
> '#FORM.F#'
> )
> WHERE ????????
>
>
> I'm totally lost.
>
>
> TIA
>
> Gilbert Midonnet
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at
http://www.coolfusion.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4