ice78991
Programmer
- Nov 20, 2006
- 216
I am using the following method to query a database
This code is in a .cfm page
<!--- GET MEMBER DETAILS --->
<CFINVOKE COMPONENT="components/manageAdvertiser"
METHOD="InitDetails"
MemberInfo = #Trim(mid)#
RETURNVARIABLE="Details">
</CFINVOKE>
It accesses a function stored in a .cfc
<cffunction name="InitDetails_admcomp" access="public" returntype="query" output="no">
<cfargument name="MemberInfo" type="string" required="yes">
<cfset var Details = "">
<CFQUERY NAME="Details" DATASOURCE="#APPLICATION.DB#" USERNAME="#APPLICATION.UN#" PASSWORD="#APPLICATION.PW#">
SELECT *
FROM Profile
WHERE MemberID_mpe = #Trim(ARGUMENTS.MemberInfo)#
ORDER BY CreatedDate_mpe
</CFQUERY>
<cfreturn Details>
</cffunction>
Is this secure or should I be implementing cfqueryparam
( which will take a lot of rewriting) I am using SQL Server 2005 so databinding is not an issue
This code is in a .cfm page
<!--- GET MEMBER DETAILS --->
<CFINVOKE COMPONENT="components/manageAdvertiser"
METHOD="InitDetails"
MemberInfo = #Trim(mid)#
RETURNVARIABLE="Details">
</CFINVOKE>
It accesses a function stored in a .cfc
<cffunction name="InitDetails_admcomp" access="public" returntype="query" output="no">
<cfargument name="MemberInfo" type="string" required="yes">
<cfset var Details = "">
<CFQUERY NAME="Details" DATASOURCE="#APPLICATION.DB#" USERNAME="#APPLICATION.UN#" PASSWORD="#APPLICATION.PW#">
SELECT *
FROM Profile
WHERE MemberID_mpe = #Trim(ARGUMENTS.MemberInfo)#
ORDER BY CreatedDate_mpe
</CFQUERY>
<cfreturn Details>
</cffunction>
Is this secure or should I be implementing cfqueryparam
( which will take a lot of rewriting) I am using SQL Server 2005 so databinding is not an issue