You should use cfqueryparam *everywhere* you could specify a literal
value.

This includes SELECT, INSERT, UPDATE and DELETE statements as well as
any DDL statements that can accept literal values.

M!ke

-----Original Message-----
From: Saturday (Stuart Kidd) [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 27, 2005 10:47 AM
To: CF-Talk
Subject: cfqueryparam

Hi,

Just wondering if my CFQUERYPARAM is correct... should I be also putting
cfqueryparam tags around the SET variables?

                     <!--- update user details to DB --->
                     <CFQUERY NAME="UpdateUserDetails"  
datasource="user020">
                         UPDATE tbl_020publicUsers
                         SET lastLogin = #UKTodayDate#,
                         daysVisited = #GetUser.daysVisited#
                         WHERE userID = <cfqueryparam
value='#Client.KissMyDate_UserID#' cfsqltype="cf_sql_integer"  
maxlength="4">
                     </CFQUERY>


Also, when I am checking a db field against another table like below
(AND userID = tbl_020publicResponses.senderUserID) should I use a
cfqueryparam in that?

         <!--- get responses details --->
         <cfquery name="FindMail" datasource="user020">
         SELECT responseID, tbl_020publicResponses.profileID,
recipientUserID, senderUserID, senderScreenName, senderEmail,
responseSubject, responseText, responseDate, responseReadStatus, userID,
screenName
         FROM tbl_020publicResponses, tbl_020publicProfiles
         WHERE recipientUserID = <cfqueryparam
value='#client.KissMyDate_UserID#' cfsqltype="cf_sql_integer"  
maxlength="4"> AND responseID = <cfqueryparam
value='#URL.viewResponseID#' cfsqltype="cf_sql_integer"  
maxlength="4"> AND userID = tbl_020publicResponses.senderUserID
         </cfquery>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:210618
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

Reply via email to