Do I need to var each structure item or just the structure declaration? I
updated the code based on your recommendations.
<cffunction name="redirectLookup" hint="looks up a requested url"
returntype="struct" output="no" access="remote" returnformat="json">
<cfargument name="domain" type="string" required="true" default=""
hint="root domain" />
<cfargument name="subFolder" type="string" required="true" default=""
hint="subFolder" />
<cfset var redirectLookup = QueryNew()>
<cfset var redirectLookupResults=StructNew()>
<cfset var redirectLookupResults.error = 0>
<cfset var redirectLookupResults.redirectURL = "">
<cfset var redirectLookupResults.redirectID = "">
<cfset var redirectLookupResults.redirectStatus = "">
<cfquery name="redirectLookup" datasource="dbRedirects" maxRows=1 >
SELECT redirectURL, redirectID, redirectStatus
FROM tbl_redirects
WHERE (redirectDomain = <cfqueryparam value="#arguments.domain#">)
and (redirectSubFolder = <cfqueryparam value="#arguments.subFolder#">)
</cfquery>
<cfif redirectLookup.RECORDCONT eq 1>
<cfset redirectLookupResults.redirectURL =
"#redirectLookup.redirectURL#">
<cfset redirectLookupResults.redirectID =
"#redirectLookup.redirectID#">
<cfset redirectLookupResults.redirectStatus =
"#redirectLookup.redirectStatus#">
<cfelse>
<cfset redirectLookupResults.error = 1>
</cfif>
<cfsetting showdebugoutput="true" />
<cfreturn redirectLookupResults>
</cffunction>
--
--
online documentation: http://openbd.org/manual/
http://groups.google.com/group/openbd?hl=en
---
You received this message because you are subscribed to the Google Groups "Open
BlueDragon" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.