Any help would be really greatful.

I have a form page where the user enters a header, content, and date for a
pressrelease
the action page should insert or update the DB.
Except the ' is causing problems

here is the code running 4.5 with Oracle 7.3 database:


<cfparam name="form.PressReleaseID" default="0">
<cfif form.PressReleaseID EQ 0>
        <cfquery name="insertArticle" datasource="#application.dsn#">
                INSERT INTO PressRelease
                        (Header, Content, PressReleaseDate)
                VALUES
                        ('#PreserveSingleQuotes(form.header)#',
'#PreserveSingleQuotes(form.Content)#', TO_DATE('#form.PressReleaseDate#',
'mm/dd/yyyy'))
        </cfquery>
        
<cfelse>
        <cfquery name="update" datasource="#application.dsn#">
                UPDATE  PressRelease
                SET 
                        Header = '#PreserveSingleQuotes(form.Header)#',
                        Content = '#PreserveSingleQuotes(form.Content)#',
                        PressReleaseDate =
TO_DATE('#form.PressReleaseDate#', 'mm/dd/yyyy')
                WHERE PressReleaseID = #form.PressReleaseID#
        </cfquery>
        
</cfif>


<cflocation url="press_release_list.cfm" addtoken="no">

------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to