Question
output from ListRest(GetAuthUser()) function not working as I expected
I am using the <cflogin> function to log users into the
site.
My code reads as follows:
<cflogin
<cfloginuser
name="sNameVariable1, sNameVariable2"
password="sPasswordVariable"
roles="sRolesVariable">
</cflogin>
This works fine. The user can login, and using the ListFirst(GetAuthUser()) and ListRest(GetAuthUser()), I can view and assigning these values to variables, I can view the values using the cfdump function.
Example
<cfset sUserFirstName = ListFirst(GetAuthUser())>
<cfset sUserID = ListRest(GetAuthUser())>
<cfoutput><cfdump var="#sUserID#"></cfoutput>
The value held in the sUserID variable is a value created by the CreateUUID() function in the INSERT statement of my user registration page for creating a user ID.
When I use the sUserID in the WHERE section of a query SELECT statement, however, the recordset returned has no data.
Example
SELECT sUserFirstName, sUserLastName
FROM hsprovider
WHERE providerID = '#sUserID#'
but, when I use the literal string that should be held in sUserID, I get the correct recordset. ie
SELECT sUserFirstName, sUserLastName
FROM hsprovider
WHERE providerID = 'STUEVEEXC-DVXTHYY54-DSFK345-ETC-ETC-ETC'
The output is what I want. I have tried various syntax changes in the where statement, with no positive affect. What am I doing wrong? Thanks so much in advance--daniel
My code reads as follows:
<cflogin
<cfloginuser
name="sNameVariable1, sNameVariable2"
password="sPasswordVariable"
roles="sRolesVariable">
</cflogin>
This works fine. The user can login, and using the ListFirst(GetAuthUser()) and ListRest(GetAuthUser()), I can view and assigning these values to variables, I can view the values using the cfdump function.
Example
<cfset sUserFirstName = ListFirst(GetAuthUser())>
<cfset sUserID = ListRest(GetAuthUser())>
<cfoutput><cfdump var="#sUserID#"></cfoutput>
The value held in the sUserID variable is a value created by the CreateUUID() function in the INSERT statement of my user registration page for creating a user ID.
When I use the sUserID in the WHERE section of a query SELECT statement, however, the recordset returned has no data.
Example
SELECT sUserFirstName, sUserLastName
FROM hsprovider
WHERE providerID = '#sUserID#'
but, when I use the literal string that should be held in sUserID, I get the correct recordset. ie
SELECT sUserFirstName, sUserLastName
FROM hsprovider
WHERE providerID = 'STUEVEEXC-DVXTHYY54-DSFK345-ETC-ETC-ETC'
The output is what I want. I have tried various syntax changes in the where statement, with no positive affect. What am I doing wrong? Thanks so much in advance--daniel
