Hi,
I'm trying to make a very simple counter for when visitors sign in to my site. I can't figure out why this is not working. The database field is a number field.
---
<cfoutput>
<cfquery name="getuser" datasource="#application.dsn#">
SELECT visits
FROM users
WHERE username = '#session.username#'
</cfquery>
<cfquery name="counter" datasource="#application.dsn#">
UPDATE users
SET visits = #Evaluate("getuser.visits + 1"
#
WHERE username = '#session.username#'
</cfquery></cfoutput>
---
An error occurred while evaluating the expression:
#Evaluate("getuser.visits + 1"
#
Cannot convert to number.
Please, check the ColdFusion manual for the allowed conversions between data types
The error occurred while processing an element with a general identifier of (#Evaluate("getuser.visits + 1"
#)
Any help is appreciated!
Thanks,
pt
I'm trying to make a very simple counter for when visitors sign in to my site. I can't figure out why this is not working. The database field is a number field.
---
<cfoutput>
<cfquery name="getuser" datasource="#application.dsn#">
SELECT visits
FROM users
WHERE username = '#session.username#'
</cfquery>
<cfquery name="counter" datasource="#application.dsn#">
UPDATE users
SET visits = #Evaluate("getuser.visits + 1"
WHERE username = '#session.username#'
</cfquery></cfoutput>
---
An error occurred while evaluating the expression:
#Evaluate("getuser.visits + 1"
Cannot convert to number.
Please, check the ColdFusion manual for the allowed conversions between data types
The error occurred while processing an element with a general identifier of (#Evaluate("getuser.visits + 1"
Any help is appreciated!
Thanks,
pt