<cfset name = form["name" & i]>
<cfset age = form["age" & i]>
<cfset sex = form["sex" & i]>
<cfif Len(variables.name) AND Len(variables.age) AND
Len(variables.sex)>
<cfquery datasource="#request.DSN#">
INSERT INTO Table(name,age,sex)
VALUES(
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#variables.name#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#variables.age#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#variables.sex#">
)
</cfquery>
</cfif>
</cfloop>
Pascal
> -----Original Message-----
> From: vishnu prasad [mailto:[EMAIL PROTECTED]
> Sent: 20 September 2004 11:02
> To: CF-Talk
> Subject: [Spam?] urgent:Coldfusion Looping
>
> Hi
>
> I got your id from houseofusion ,and also I got ur reply in
houseoffusion
>
>
>
> i have a display page like below
> Display page
> Name age sex(controls: Name1 age1 sex1)
>
> Name age sex(controls: Name2 age2 sex2)
>
> Name age sex(controls: Name3 age3 sex3)
>
> Name age sex(controls: Name4 age4 sex4)
>
> in the action page Action page
>
> Now how can I add the name,age,sex in the table ? and also i should
not
> insert if the row is emplty
>
> while input 2 row can have the data and rest will not have the date ,
in
> that case i need to insert 2 rows in the table ,if the four rows are
> filled wid data then i want to insert the 4 rows in a table
>
> regards
> Vishnu
>
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

