Good morning,
I’m having trouble setting a SESSION.variable to type Integer.
Specifically, the problem is the MEMBERID session variable
Inside Application.cfm I have this…
CLIENTMANAGEMENT="Yes"
SESSIONMANAGEMENT="Yes"
applicationtimeout="#CreateTimeSpan(0,0,30,0)#">
And in the Database, MemberID is defined as INT(10)
Then in the template that gets the memberid from the database I have this…
<CFOUTPUT Query = 'authenticate'>
<CFSET SESSION.verified = "Yes">
<CFSET SESSION.memberID = #memberID#>
</CFOUTPUT>
Then I try to store user data into the database…
<CFQUERY Name="AddNewEntry" datasource="Earthmatters">
Insert into entries (date, memberid,personid,year,month,day,time,event,entryprivacy) VALUES (Now(), <cfqueryparam value=SESSION.memberID CFSQLType = "CF_SQL_INTEGER">, <cfqueryparam value=SESSION.personid CFSQLType = "CF_SQL_INTEGER">, <cfqueryparam value='#nyear#' CFSQLType = "CF_SQL_INTEGER">, <cfqueryparam value='#nmonth#' CFSQLType = "CF_SQL_VARCHAR"> , <cfqueryparam value='#nDay#' CFSQLType = "CF_SQL_INTEGER">, '#nTime#', '#nEvent#', '#nEntryPrivacy#')
</CFQUERY>
But after all that, I get this error…
Lucee 5.2.6.60 Error (expression)
Message : cannot cast [SESSION.memberID] string to a number value
I never set SESSION.MemberID as a String, in fact it’s set as INT a number of times?
I’m stuck. Can anyone help me out of the Bog ?
PS - I “Starred” Lucee at GitHub (Star No. 443)