• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Ich kann den Fehler in diesem Code nicht finden.

Guest
Aug 27, 2015 Aug 27, 2015

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>

Views

241

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 27, 2015 Aug 27, 2015

Copy link to clipboard

Copied

Can you share the error that you are getting?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 27, 2015 Aug 27, 2015

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 03, 2015 Sep 03, 2015

Copy link to clipboard

Copied

LATEST

<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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation