How about in your filter code, you unset any variable before you set it. that's prevent the duplication, and let you keep the rest of the code as-is. Most likely that'd be in the code that renders the link for adding filter so that it doesn't contain another value for the same filter it'd be setting, if I understand what you're doing.
cheers, barneyb On 8/1/05, Cameron Johnson <[EMAIL PROTECTED]> wrote: > Using a CFC, I've got a table of results from a getAllRecords method. I want > to filter those results based on some variables that the user clicks on > individually. > > So, in the getAllRecords method, my SELECT query will be: > > SELECT * > FROM table > WHERE value1 = #arguments.value1# > <cfif isDefined("arguments.value2")> AND value2 = #arguments.value2#</cfif> > <cfif isDefined("arguments.value3")> AND value3 = #arguments.value3#</cfif> > > (cfqeryparam eliminated for this post. Rest assured, I'm using it.) > > My question is, what's the most efficient way to collect and pass those three > variables as a group? > > At first, I created a variable called URLVariables, and appended each > variable as the user clicked each one. That was nice, in that the user could > build up multiple filters with a few clicks. And, that saved time when adding > new filters, in that I did not have to change each link on the page and add a > new variable to a long list of varbiales joined by &. > > However, that left me open to doubling-up on one variable, hence getting and > illegal WHERE clause: > > WHERE value2 = A, B > > (value2 is an integer) > > There has to be a better way to do this. Any thoughts or experiences to speak > of? > > Thanks, > > Cameron > -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 50 invites. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:213422 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54