You can't use cfqueryparam like this, it won't get evaluated. It has to
be in the cfquery.

<cfquery datasource="media" name="get_office">
select office_id
from office
#request.filter#
where 0=0
<cfif len(attributes.office_num)>
and office_num in (<cfqueryparam list='Yes'
value='#attributes.office_num#'
cfsqltype='CF_SQL_VARCHAR'>)
</cfif>
</cfquery>

> -----Original Message-----
> From: Joshua OConnor-Rose [mailto:[EMAIL PROTECTED]
> Sent: 29 July 2004 17:17
> To: CF-Talk
> Subject: Question about cfqueryparam
>
> Sorry if this question has been answered already.
>
> I searched the list but putting that particular
> tagname returns plenty and most of it is advice to use
> it.
>
> For search pages I started to put the where statement
> together into a variable request.filter
>
> this worked fine but we just upgraded the server from
> 4.5 to 6.1 and I wanted to start throwing in
> cfqueryparam.
>
> So when I use this:
> <cfset request.filter = "where 0=0">
> <cfif len(attributes.office_num)>
> <cfset request.filter = request.filter & " and
> office_num in (<cfqueryparam list='Yes'
> value='#attributes.office_num#'
> cfsqltype='CF_SQL_VARCHAR'>)">
> </cfif>
>
> And then do this:
>
> <cfquery datasource="media" name="get_office">
> select office_id
> from office
> #request.filter#
> </cfquery>
>
> I get an error.
>
> I can't quite figure out what I'm missing
>
> any help?
>
> -Joshua O'Connor-Rose
> -All is Good
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We finish.
> http://promotions.yahoo.com/new_mail
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to