Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SENDING DATA ALL AT ONE TIME ????

Status
Not open for further replies.

kingjjx

Programmer
Joined
Sep 18, 2001
Messages
181
Location
US
hi, how do you send data at once in the same table ?
The fields in the table are Fname, Lname, Sex, Race, Age
Example:
Fname:______ Fname:_____
Lname:______ Lname:_____
Sex:___ Sex:___
Race:___ Race:____
Age:___ Age:____

Fname:______ Fname:_____
Lname:______ Lname:_____
Sex:___ Sex:___
Race:___ Race:____
Age:___ Age:____
[SUBMIT]

Please help
thanks
-jon
 
I'm not sure what you want, but it may be this.

<!--- Form to be submited --->

<form action=&quot;nextpage.cfm?total=10&quot; method=&quot;post&quot;>
<table cellpadding=0 cellspacing=0 border=0>

<cfloop index=&quot;index&quot; from=&quot;1&quot; to=&quot;10&quot;>
<tr>
<td>FName</td>
<td><input type=&quot;text&quot; name=&quot;FName_
#index#&quot;>
<td>LName</td>
<td><input type=&quot;text&quot; name=&quot;LName_
#index#&quot;>
<td>Sex</td>
<td><input type=&quot;text&quot; name=&quot;Sex_
#index#&quot;>
<td>Race</td>
<td><input type=&quot;text&quot; name=&quot;Race_
#index#&quot;>
<td>Age</td>
<td><input type=&quot;text&quot; name=&quot;Age_
#index#&quot;>
</tr>
</cfloop>
</table>
</form>



<!--- INSERT Page For ACCESS level DB --->

<cfloop index=&quot;index&quot; from=&quot;1&quot; to=&quot;#url.total#&quot;>
<cfquery datasource=&quot;myDB&quot;>
INSERT INTO myTable(FName,LName,Sex,Race,Age)
VALUES(
'#EVALUATE(&quot;FROM.FName&quot;&index)#',
'#EVALUATE(&quot;FROM.LName&quot;&index)#',
'#EVALUATE(&quot;FROM.Sex&quot;&index)#',
'#EVALUATE(&quot;FROM.Race&quot;&index)#',
#EVALUATE(&quot;FROM.Age&quot;&index)#
)
</cfquery>
</cfloop>

<!--- INSERT Page For MSSQL2K level DB --->
<cfquery datasource=&quot;myDB&quot;>
<cfloop index=&quot;index&quot; from=&quot;1&quot; to=&quot;#url.total#&quot;>
INSERT INTO myTable(FName,LName,Sex,Race,Age)
VALUES(
'#EVALUATE(&quot;FROM.FName&quot;&index)#',
'#EVALUATE(&quot;FROM.LName&quot;&index)#',
'#EVALUATE(&quot;FROM.Sex&quot;&index)#',
'#EVALUATE(&quot;FROM.Race&quot;&index)#',
#EVALUATE(&quot;FROM.Age&quot;&index)#
)
</cfloop>
</cfquery>

The difference between the two DB types
is in MSSQL2K you can send all your info
in one database call making the code
more efficiant.

Hope this is what you are after.
 
Hey, what does this part of the code do ??

<cfloop index=&quot;index&quot; from=&quot;1&quot; to=&quot;10&quot;>

when you say .. from=&quot;1&quot; to=&quot;10&quot;
can I change this figures ? what would be affected ?
thanks
-jon
 
hey .. in this line ..'#EVALUATE(&quot;FROM.FName&quot;&index)#',
did you mean to say FROM.Fname or FORM.Fname ???

thanks
-jon
 
hey dude, where are you ? help me out please !!!
 
try: <cfloop index=&quot;index&quot; from=&quot;1&quot; to=&quot;2&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top