Copy link to clipboard
Copied
Nachdem ich auf einer anderen File den Submit button betätige und zurück komme, gibt er mir nur einen error aus, da er es nicht schafft, es auf die Datenbank zu updaten.
Bitte um Hilfe
danke im Voraus !
<cfif isdefined('form.titel')>
<cfif isdefined('form.filename')>
<cffile action="upload" filefield="form.filename" destination="C:\inetpub\wwwroot\support\upload\presentation\vorlagen\" result="resultUpload" nameconflict="makeunique" />
</cfif>
<cfquery name="updPPtFile" datasource="#application.global.dsn#" result="resultUpdPpt">
UPDATE ppt_files
SET bezeichnung = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.titel#" />,
gruppenID = <cfqueryparam cfsqltype="cf_sql_integer" value="#form.gruppeID#" />
<cfif isdefined('form.filename')>,
ppt = <cfqueryparam cfsqltype="cf_sql_varchar" value="\upload\presentation\vorlagen\#resultUpload.serverFile#" />
</cfif>
WHERE ID = <cfqueryparam cfsqltype="cf_sql_integer" value="#form.pptID#" />
</cfquery>
<cfif resultUpdPpt.recordCount is 0>
<cfquery name="insPptFile" datasource="#application.global.dsn#">
INSERT INTO ppt_files
(bezeichnung, gruppenID, ppt)
VALUES
<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.titel#" />,
<cfqueryparam cfsqltype="cf_sql_integer" value="#form.gruppeID#" />,
<cfif isdefined('form.filename')><cfqueryparam cfsqltype="cf_sql_varchar" value="\upload\presentation\vorlagen\#resultUpload.serverFile#" /><cfelse>NULL</cfif>)
</cfquery>
</cfif>
</cfif>
Copy link to clipboard
Copied
Can you share the error that you are getting?
Copy link to clipboard
Copied
it just says that the website isnt aviable anymore. but if i delete those lines the website works perfectly.
have you ever heard of that kind of problem?
Copy link to clipboard
Copied
<cfquery name="updPPtFile" datasource="#application.global.dsn#" result="resultUpdPpt">
UPDATE ppt_files
SET ...
</cfquery>
<cfif resultUpdPpt.recordCount is 0>
...
</cfif>
This is wrong, for it treats an update query as if it is a select query.