I've had good luck using <CFLOOP> to run through a list of checkboxes and
write single values to record rows in a database.
However, I've now got a PAIR of checkbox/text field that needs to write to
the same row.
Record in database is set up like:
ID A0_ORDER AO_QUANT
On my page, there's probably fifty each AO_ORDER checkbox and AO_QUANT text
field pairs.
Tried a nested loop like below, and it properly writes the correct pairs to
the correct rows together, except it writes the values duplicate times.
****************************************************************************
**
<CFLOOP LIST = "#AO_ORDER#" INDEX = "ITEMS">
<CFLOOP LIST = "#AO_QUANT#" INDEX = "QUANT">
<CFQUERY name="ORDERS" datasource="AO_LITERATURE">
INSERT INTO PRODUCT_ORDERS (ORDER_ID, AO_ORDER, AO_QUANT)
VALUES ('#CLIENT_ID#', '#ITEMS#', '#QUANT#')>
</CFQUERY>
</CFLOOP>
</CFLOOP>
****************************************************************************
**
If you could do something like:
<CFLOOP LIST = "#AO_ORDER#, #AO_QUANT#" INDEX = "ITEMS, QUANT">
instead of the incorrect nested loop it would be nice, but I haven't figured
out how to get that to work either. Probably a syntax issue.
Advise?
Thanks!!
--
Les Mizzell
****************
Who Needs Intel?
ATHLON INSIDE!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists