On Jan 14, 7:36 pm, Jason King <[email protected]> wrote:
> I can't decide if it would be better to create a new variable and use that
> in the query, rather than try and combine evaluate and cfqueryparam. I
> thought about structkeyexists, but the struct has a variable in it.. so I'm
> not sure how that would evaluate.
>
> <CFSET index_thumbnail_url = evaluate("photo_info_#index#.public_url")>
>
> ---> SET thumbnail_url = <cfqueryparam value="#index_thumbnail_url#">,
>
> My only issue is that I'm creating an extra variable where I might not need
> one. That said... Is that the best way, or is there a way to evalaute a
> value within a cfqueryparam statement that is wtihin a query?
The Evaluate() isn't needed if you scope your variables.
Instead of writing:
<cfset index_thumbnail_url = Evaluate("photo_info_#index#.public_url")
>
...you could write:
<cfset variables.index_thumbnail_url = variables['photo_info_' & index]
['public_url']>
...or...
<cfset variables.index_thumbnail_url = variables['photo_info_#index#']
['public_url']>
It would be wise to always scope your variables no matter the
situation.
--
Open BlueDragon Public Mailing List
http://www.openbluedragon.org/ http://twitter.com/OpenBlueDragon
mailing list - http://groups.google.com/group/openbd?hl=en
!! save a network - please trim replies before posting !!