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!

HELP - How to send data multiple times ? 1

Status
Not open for further replies.

kingjjx

Programmer
Joined
Sep 18, 2001
Messages
181
Location
US
Hi I have a page where the Employer logs his work hours.
On top of the page is a drop down that he picks his Employer ID

then below it, he enters his work hours.
Now there are about 20 rows of work hours in my table, now my question is how can i enter the EmployerID 20 times in the EmpID field and i only have 1 dropdown box ??

hope i makes sense.
 
A <CFLOOP> over the query?

Something like.. say you've got

EmpID
Text1_1 Text2_1 Text3_1
Text1_3 Text2_2 Text3_2

so you're query might look something like

Code:
<CFLOOP from=1 to=20 index=&quot;thisrow&quot;>
 <CFQUERY datasource=&quot;mydsn&quot;>
  INSERT INTO MyTable(EmpID,dbField1,dbField2,dbField3)
  VALUES('#EmpID#','#evaluate(&quot;text1_#thisrow#&quot;)#','#evaluate(&quot;text2_#thisrow#&quot;)#','#evaluate(&quot;text3_#thisrow#&quot;)#')
 </CFQUERY>
</CFLOOP>

That would save you from having to enter the same query 20 times with a little change.. of course alter it so it works how you want.

HTH
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top