1. No escape character with single quote; using cfqueryparam - query does not fail, but no record is returned
2. Using escape character with single quote; and using cfqueryparam - query does not fail, but no record is returned
3. Using escape character with single quote; no cfqueryparam - passing it straight in between single quotes - query fails to execute due to the value passed in for the name
4. No escape character with single quote; no cfqueryparam (passing it '#strName#') - query executes and the correct record is returned
However, I do not feel comfortable trusting just any user data in the last name field. I want to use cfqueryparam to prevent potential sql injections. Here is part of my query that fails:
SELECT FIRSTNAME, LASTNAME
FROM T_USER
WHERE UPPER(T_USER.LASTNAME) = <cfqueryparam cfsqltype="cf_sql_varchar" value="#UCase(queryLastName)#">
But, this works:
SELECT FIRSTNAME, LASTNAME
FROM T_USER
WHERE UPPER(T_USER.LASTNAME) = '#UCase(queryLastName)#'
Any help is appreciated. Thanks.
-Chris
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

