•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 374,009 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,893 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser:
Views: 1129 | Replies: 6 | Solved
![]() |
•
•
Join Date: Feb 2008
Posts: 16
Reputation:
Rep Power: 1
Solved Threads: 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> Last edited by peter_budo : Feb 6th, 2008 at 1:02 pm. Reason: Please use [code] tags for posting your coding examples
•
•
Join Date: Nov 2007
Posts: 51
Reputation:
Rep Power: 1
Solved Threads: 9
Erm can I make a suggestion that you look at using cfqueryparam as well, if anyone ever put a ' in any of the fields on the screen they can then do some nasty SQL injection into your code.
Nige
( See many references on the web about SQL Injection inculding http://msdn.microsoft.com/msdnmag/is.../SQLInjection/ )
Nige
( See many references on the web about SQL Injection inculding http://msdn.microsoft.com/msdnmag/is.../SQLInjection/ )
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ColdFusion Marketplace
Similar Threads
- Array wrapped SQL - single Quotes error (ColdFusion)
- MS Access Error - sometimes (ColdFusion)
- Error Executing Database Query on server (ColdFusion)
- Trouble getting confirmation of authentication (ColdFusion)
- SQL Delete/Update Error (ColdFusion)
- Check new UserID - if taken or not (ColdFusion)
- Error accessing database (ColdFusion)
- insert database (ColdFusion)
- Error while processing : server ending byitself and database not connected... (ColdFusion)
Other Threads in the ColdFusion Forum
- Previous Thread: Check to see if a cfwindow exists
- Next Thread: How to find location of cold fusion database


Linear Mode