SELECT *
FROM Contacts
WHERE Contacts.ContactType = 'Physician'
AND Contacts.#FORM.Field# = '#FORM[FORM.Field]#'
ORDER BY Contacts.LastName

And then throw in some cfqueryparams.

But what's more interesting is how to protect against SQL injection with
Contacts.#FORM.Field#! Is it a problem?

If you don't mind tightening things up a bit, check FORM.Field is one of the
available columns.

Adrian

-----Original Message-----
From: David Moore, Jr. [mailto:[EMAIL PROTECTED]
Sent: 10 September 2008 15:04
To: CF-Talk
Subject: Re: How NOT to Evaluate (moved from cfset so not to confuse
topic)


Ray wrote:

> As someone who used to always pounce on folks for using evaluate, I>
believe I remember reading recently a blog entry from an Adobian that>
points out that evaluate is not nearly as slow as it used to be.> > Now when
I recommend against Evaluate I do so on readability terms> rather than
performance. For almost every use of evaluate I see in the> field, the code
can be rewritten in a cleaner, easier to understand> manner.
How then would you approach the following without Evaluate, because it was
the only way I could get it to work: (oh, let the fun begin, the shame. I
probably committed at least 7 deadly sins alone. And yes, I am using Access.
Moan. Laughter.) In my ever growing need to expand my knowledge base (and
look less like an idiot to this list) HELP? It's a query that accepts
information from a Search field to run a query.

<cfquery name="getPhysicianRecords" datasource="#DSN#">SELECT *FROM
ContactsWHERE Contacts.ContactType = 'Physician'
 AND Contacts.#FORM.Field# = '#Evaluate("FORM.#FORM.Field#")#'ORDER BY
Contacts.LastName

~David


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312303
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to