evaluate is the least of your problems.  lets start with the database. it is
not normalized. read : http://www.swynk.com/friends/putnam/normarticle.asp
for a better explanation. basically, whenever you find yourself making
column names that end with a number, you have a non-normalized table
structure.

regardless... if you were to do say :

<form >

<select name="myselect"></select>
<select name="myselect"></select>
<select name="myselect"></select>
<select name="myselect"></select>

</form>

the submit would look like this:

value1,value2,value3,value4

you could then treat form.myselect as a list and loop over it to do the
inserts.

Alexander Sicular
Chief Technology Architect
The Neurological Institute of New York
Columbia University
212.305.1318
as867 {at} columbia [dot] edu


> -----Original Message-----
> From: Jen R [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 07, 2001 3:17 PM
> To: CF-Talk
> Subject: Dynamic Variable Names
> 
> 
> 
> Ok...I was recently sitting in a meeting with some people in 
> my department about an application I'm developing.  Seeing as 
> I am *the* developer I could really use some help.  It's an 
> estimating/billing application.  There is a possibility of 
> twenty different lines for materials used and twenty slots 
> for it to go in the database.  Pretty simple.  I was just 
> going to put in twenty different drop down boxes for this, 
> which is the way they wanted it done.  Well, not every 
> project will use 20 different materials.  Some might use 2, 
> some might use 10, and some might use 20.  My supervisor (who 
> has enough CF experience to make him dangerous sometimes) 
> thought it looked cluttered like that so he said we'll let 
> you choose how many lines you want for materials. "we can do 
> that, no problem!" he says.  So I'm left to figure out how 
> "we" are going to do it.
> 
> I have the form where they enter in how many lines they want, 
> and I have the form with that number of lines and 
> corresponding fields.  Not a problem yet, but now here's 
> where I find my difficulty...  When I submit this form to the 
> database I now have to figure out how to do the SQL submit 
> statement where the number of variables is dynamic.  In my 
> database I have the fields "material1, material2, material3, 
> material4,....material20" and can build the first part of the 
> insert statement using a CFLOOP, but when I come to the 
> Values() part of the insert...how do I dynamically create that.
> 
> For example:  The user wanted 5 lines for materials.  On the 
> form the user fills out the boxes for material1, material2, 
> material3, material4, material5.  How do I dynamically create 
> the Values('#form.material1#', '#form.material2#', 
> '#form.material3#', '#form.material4#', '#form.material5#')?  
> I have tried the Evaluate function before and didn't have too 
> much luck.
> 
> Suggestions?  It seems like the whole project hinges on this 
> dynamic variables problem.
> 
> Thank you...thank you....thank you!
> 
> 
> 
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Mail Personal Address - Get email at your own domain 
> with Yahoo! Mail.
> 
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to