Hello Friends I ran into a syntax error updating a form, I have added a comment to the line below, Please could anyone tell me what I did wrong!!!!

<cfquery name="update student" datasource="#Request.super#">
UPDATE student
SET
studentfirstname='#Trim(Form.studentfirstname)#',.
studentlastname='#Trim(Form.studentlastname)#',.
address='#Trim(Form.address)#',.
city='#Trim(Form.city)#',.
state='#Trim(Form.state)#',.
studentage='#Trim(Form.studentage)#',.
studentclass='#Trim(Form.studentclass)#',.
studentstartdate='#Trim(Form.studentstartdate)#',.
studentgraduationdate='#Trim(Form.studentgraduationdate)#',.
comments=
<cfif Len(Trim(Form.comments)) GT 0>
'#Trim(Form.comments)#'
<cfelse>
NULL
</cfif>
WHERE
studentlastname = #Trim(Form.oldstudent)#,(THIS IS WHERE THE ERROR IS)
</cfquery>
<cflocation url="Finished.cfm?msg=#URLEncodedFormat('#Form.studentlastname# has been updated in the database.')#">
<html>
<head>
<title>studenteditaction page</title>
</head>

<body>
</body>
</html>

Hello Zoid,

You might try single qoutes in around your variable. Hopefully that will do it.

Matt

Hello Zoid,

You might try single qoutes in around your variable. Hopefully that will do it.

Matt

Hi Matt, thanks for the post. I tried single quotes but it still gave the same error

Still need help!!!!
I am using a single table with Mysql 5.0.45 and it says check syntax error.
is this a bug or I am using the wrong syntax.

I found the solution it was the dots behind my declaration.:)

This question has already been answered. Start a new discussion instead.