I am building a call tracking system for my company and I need to give the user a Ticket ID number so that they can use it as a reference number.
Action of the form to enter in a computer problem
CODE
<cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "Task">
<cfquery datasource="ibotix" username="root" password="ibotix$6416" name="addtick">
INSERT INTO worklist(clientid,dateposted,description,subject)
VALUES(<cfqueryparam value="#form.clientname#">,
<cfqueryparam value="#dateformat(now())#" cfsqltype="cf_sql_date">,
<cfqueryparam value="#form.taskinfo#" cfsqltype="cf_sql_longvarchar">,
<cfqueryparam value="#form.subject#">)
</cfquery>
<cflocation url="index.cfm?recordadded=y&trackingnum=#addtick.GENERATED_KEY#">
</cfif>
I am using MySQL 4.1 and I read on the livedocs that the GENERATED_KEY variable will call back the id of the row that was inserted but I get the "Generated Key is undefined in addtick" error message. Can anyone see what I am doing wrong?