Christina:
Do this:
<cfquery name="insert_mcd">
insert into RTP_MCD
(RTP_ID, MCD)
values
(<cfqueryparam value="#ThisNewID#">, <cfqueryparam value="#mcd#">)
</cfquery>
Using the cfqueryparam will protect your query from malicious attacks to an
extent, but more importantly in this case...
The value is sent to the database 'encapsulated' separately from the query,
so the database reads the value as only the value to that insert, not
'syntax' to the surrounding SQL statement.
William
----------------------------------
William Seiter
IT Web Developer / Consultant
Is your income limited by the red tape and paperwork? Let SoftEx BackOffice
help you. They know how to take care of the 'busy work' of your contracts
and let you focus on the 'WOW' factor.
http://www.softexconsulting.com/backoffice.cfm
::-----Original Message-----
::From: Christina K [mailto:[EMAIL PROTECTED]
::Sent: Friday, October 17, 2008 9:02 AM
::To: cf-newbie
::Subject: Re: Insert to DB from field with multiple select
::
::I used the cfdump and the form is passing a comma separated list of
::values, so that's good. As to your question Nick, my preference for how
::to use the data is to generate multiple database entries in this one
::table. There is a many-to-many relationship between mcd and rtp_id. I
::have a rtp_master table, which houses most of the data related to the rtp
::project (rtp_id being the primary key of that table) and a mcd table with
::a primary key of mcd. The table this data is getting sent to is a bridge
::table between the other two. The data should get entered one at a time,
::in multiple rows. So if the user chose mcd 7335, 7345, and 7610 for rtp
::200 I should end up with 3 rows of data: 200, 7335; 200, 7345 and 200,
::7610.
::
::I think I need to loop over the query to make this work, it's just that
::none of the ways I've tried to use to loop are working. Sorry for being
::misleading in the first post.
::
::
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4059
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15