- see footer for list info -<
Hi Adrian.
I am using CF6.1 with SQL 2K
I can't switch debugging on as it causes the server to fall over and die so
I can't see whats happening really.
I have a table renamed to tbJoinIncidentToType
The idea is that the form returns a list of selected incident types 1,4,7,9
for example
This then gets written to the table (done this way to keep relational -
rather than having a list)
The table is .....
IncidentType2TypeIDPK (Int) (PK)
IncidentTypeIDFK (INT) (FK) (This is the pointer from another table - set as
session.LastRecordID)
IncidentTypeID (INT)
Im hoping that the loop will take the list elements and write them in the
table like this
1 43 4
2 43 5
3 43 6
4 43 7
I have alteres the code so that only the pointer is written at the moent
.....
<cfcase value="11"><!--- Write the data for part two of the form --->
<cfoutput>#form.IncidentType# #Session.LastRecordID#</cfoutput>
<cfloop
index = "ListElement"
list = "#form.IncidentType#"
delimiters = ",">
<cfquery datasource="#Application.RacistDSN#"
name="AddPartTwo">
INSERT INTO tblJoinIncidentToType
(
IncidentTypeIDFK
)
VALUES
(
#Session.LastRecordID#
)
</cfquery>
</cfloop>
</cfcase>
But it still doesn't work ....
Regards - Paul
From: "Adrian Lynch" <[EMAIL PROTECTED]>
Reply-To: Coldfusion Development <[email protected]>
To: "Coldfusion Development" <[email protected]>
Subject: RE: [CF-Dev] List Loop
Date: Wed, 22 Mar 2006 12:58:52 -0000
>- see footer for list info -<
You don't say what's not happening.
What datatypes are your columns?
'#ListElement#' instead of #ListElement# if it's a string.
Adrian
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Paul Swingewood
Sent: 22 March 2006 12:40
To: [email protected]
Subject: [CF-Dev] List Loop
>- see footer for list info -<
Can anyone see whats wrong with this please ...?
<cfoutput>#form.IncidentType#</cfoutput>
<cfloop
index = "ListElement"
list = "#form.IncidentType#"
delimiters = ",">
<cfquery datasource="#Application.RacistDSN#"
name="AddPartTwo">
INSERT INTO tblIncidentTypeToIncident
(
IncidentTypeIDFK,
Incidentype
)
VALUES
(
#Session.LastRecordID#,
#ListElement#
)
</cfquery>
</cfloop>
Regards - Paul
_______________________________________________
For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo
--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help
-<
_______________________________________________
For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo
--
CFDeveloper Sponsors:-
- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<