**********************************************************************
WESTMINSTER CITY COUNCIL
Please refer to the disclaimer beneath this message
**********************************************************************

Yep, that's how my page is working. Using the cfqueryparam has fixed the
problem.  I definately need to look into what "cfqueryparam" can do, thanks
to everyone whos helped me with this.

Stephen
-----Original Message-----
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]]
Sent: 27 September 2002 15:10
To: CF-Talk
Subject: Re: Error with a simple expression.


Adams, Stephen wrote:
> 
> I tried your idea, and it still didn't work. I am trying to pass a link's
> (URL's) display name, which is "What's New" so I used your idea like this:
> 
>  <cfset LoopDisplayName = "#FormDisplayname[UpdateLoopIdx]#">
>       
>       <cfquery name="UpdateLinks" datasource="CommonSpot-Wire">
>         UPDATE CouncilEmployeeLinks 
>         SET   UserID          = '#session.CORNTAccount#',
>               link_type       = '#FormLinkType[UpdateLoopIdx]#',
>               link_address    = '#FormLinkAddress[UpdateLoopIdx]#',
>               display_name    = '#PreserveSingleQuotes(What's New)#',
>               myLinks_section = '#Evaluate("form.linkSection" &
> UpdateLoopIdx)#',
>               date_added      = '#DateFormat(Now(),"dd/mm/yyyy")#'
>         WHERE ID = '#FormLinkID[UpdateLoopIdx]#'      
>       </cfquery>

Use cfqueryparam. I presume your formfields are actually name linktype1, 
linktype2, linktype3 etc. which would lead to the code below:

<cfquery name="UpdateLinks" datasource="CommonSpot-Wire">
   UPDATE CouncilEmployeeLinks
   SET
     UserID          =<cfqueryparam cfsqltype="cf_sql_varchar" 
value="#session.CORNTAccount#">,
     link_type       = <cfqueryparam cfsqltype="cf_sql_varchar" 
value="#Form["LinkType" & UpdateLoopIdx]#">,
     link_address    = <cfqueryparam cfsqltype="cf_sql_varchar" 
value="#Form["LinkAddress" & UpdateLoopIdx]#">,
     display_name    = <cfqueryparam cfsqltype="cf_sql_varchar" 
value="#Form["Displayname" & UpdateLoopIdx]#">,
     myLinks_section = <cfqueryparam cfsqltype="cf_sql_varchar" 
value="#form["linkSection" & UpdateLoopIdx]#">,
     date_added      = current_date
   WHERE ID = <cfqueryparam cfsqltype="cf_sql_varchar" 
value="#Form["LinkID" & UpdateLoopIdx]#">
</cfquery>

Jochem


______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to