Oh functions, how I loathe thee...
I have a form that submits to another page, and on the target page I'm trying to add a function to log the activity.
So I did this:
Target page:
<cfinvoke component="actionlog" method="additem">
<cfinvokeargument name="details" value="Edited user: #FORM.email#">
</cfinvoke>
And the cfc:
<cfcomponent>
<cffunction name="additem" access="public">
<cfargument name="details" type="string" required="yes">
<cfquery name="addlog" datasource="hepoffice">
INSERT INTO actions
( timestamp
, user
, action )
VALUES
( '#DateFormat(Now(), "yyyy-mm-dd|hh:mm:ss")#'
, '#GetAuthUser()#'
, <cfqueryparam value="#arguments.details#" cfsqltype="cf_sql_varchar"> )
</cfquery>
</cffunction>
</cfcomponent>
I've done this sort of thing in the past, and it's worked, but not I'm getting an error:
Error Executing Database Query.
Syntax error in INSERT INTO statement.
The error occurred in D:\Inetpub\staffnet_test\hep\admin\actionlog.cfc: line 12
Called from D:\Inetpub\staffnet_test\hep\admin\hepadmin.cfm: line 87
Called from D:\Inetpub\staffnet_test\hep\admin\hepadmin.cfm: line 75
Called from D:\Inetpub\staffnet_test\hep\admin\hepadmin.cfm: line 64
Called from D:\Inetpub\staffnet_test\hep\admin\hepadmin.cfm: line 1
Called from D:\Inetpub\staffnet_test\hep\admin\hepadmin.cfm: line 1
Called from D:\Inetpub\staffnet_test\hep\admin\actionlog.cfc: line 12
Called from D:\Inetpub\staffnet_test\hep\admin\hepadmin.cfm: line 87
Called from D:\Inetpub\staffnet_test\hep\admin\hepadmin.cfm: line 75
Called from D:\Inetpub\staffnet_test\hep\admin\hepadmin.cfm: line 64
Called from D:\Inetpub\staffnet_test\hep\admin\hepadmin.cfm: line 1
Called from D:\Inetpub\staffnet_test\hep\admin\hepadmin.cfm: line 1
10 : ( '#DateFormat(Now(), "yyyy-mm-dd|hh:mm:ss")#'
11 : , '#GetAuthUser()#'
12 : , <cfqueryparam value="#arguments.details#" cfsqltype="cf_sql_varchar"> )
13 : </cfquery>
14 : </cffunction>
What am I doing wrong?
