Hi all,
My action template is supposed to insert classID, location and date into
a table in my database. When creating new records in the form I provide,
I want the user to be able to supply a comma delimited list of dates. I
think the loop in the action template successfully extracts individual
dates from the date list, but there is a syntax error in the insert
command. Everything works if I don't try to insert the date, so that
must be where the syntax error occurs. Can anybody tell me what my date
syntax error is?
Thanks in advance!
Megan
<<<The action template code is shown below>>>
<CFIF IsDefined("FORM.scheduleID")>
<CFUPDATE DATASOURCE="calkayak" TABLENAME="class_schedule">
<CFELSE>
<cfoutput>
<cfset dategroup=form.date>
<cfloop index="x" from=1 to=#ListLen(dategroup)#>
<cfset onedate=ListGetAt(dategroup,#x#)>
<cfquery datasource="calkayak">
insert into class_schedule (classID, location, date)
values(#form.classID#, '#form.location#', '#onedate#')
</cfquery>
</cfloop>
</cfoutput>
</CFIF>
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists