0

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>
3
Contributors
6
Replies
7
Views
9 Years
Discussion Span
Last Post by zoid777
0

Hello Zoid,

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

Matt

0

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

0

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.

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.