Copy link to clipboard
Copied
I can't figure out what is wrong in my update statement. I did a cfdu
mp for the form.id just before this query and I get the form ID, so it's passing my ID, but why is my q
uery throwing this error?
error:
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement. | ||||||||
The error occurred in C:\Inetpub\wwwroot\website\admin\cms\babyAction.cfm: line 54 | ||||||||
52 : baby_port.weight = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.weight#">, 53 : baby_port.TimeB = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.tob#">, 54 : WHERE baby_port.ID = <cfqueryparam value="#FORM.ID#" cfsqlType="CF_SQL_INTEGER"> 55 : </cfquery> 56 : <cflocation url="babyPort.cfm?ID=#ID#" addtoken="no"> | ||||||||
| ||||||||
Resources: |
Here is my query:
<cfquery datasource="#APPLICATION.dataSource#">
UPDATE baby_port
SET
baby_port.dob = <cfqueryparam cfsqltype="cf_sql_date" value="#form.edit1#">,
baby_port.Name = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.Name#">,
<cfif fileuploaded is true>
baby_port.MYFile = <cfqueryparam cfsqltype="cf_sql_varchar" value="#uploadedfile#">,
</cfif>
baby_port.Body = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#form.PDSeditor#">,
baby_port.weight = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.weight#">,
baby_port.TimeB = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.tob#">,
WHERE baby_port.ID = <cfqueryparam value="#FORM.ID#" cfsqlType="CF_SQL_INTEGER">
</cfquery>
I don't understand what I'm doing wrong here. Can anyone help me? Is it more then something in this query? passing the wrong variable maybe? I can provide more code if needed.
thank you.
Copy link to clipboard
Copied
You have an extra comma after baby_port.TimeB