macromedia.coldfusion.advanced_techniques
[Top] [All Lists]

Inserting a record, not working. Please help

Subject: Inserting a record, not working. Please help
From: "CFmonger"
Date: Wed, 11 Feb 2009 14:55:15 +0000 UTC
Newsgroups: macromedia.coldfusion.advanced_techniques

Hello;
 I am stumped. I am trying to get this code to insert a new record, but when it 
goes through the code, it loses the record and doesn't insert it to the db. 
What am I missing? I can't figure it out.

 My code:

 <cfif isDefined("Form.newEdit_OK")>

 <cfif isDefined("Form.RecordID")>
 here is my query if it is updating and existing record
 <cfelse>
 <cfquery datasource="#APPLICATION.dataSource#" dbtype="ODBC">
 INSERT INTO news 
 (title, newsDate, htmlList)
 VALUES (<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.title#">, 
 <cfqueryparam cfsqltype="cf_sql_date" value="#form.newsDate#">, 
 <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#form.PDSeditor#">)
 </cfquery>
 <cflocation url="news_RecordView.cfm">
 </cfif>

 What did I miss? I can't figure it out.

 CFmonger


<Prev in Thread] Current Thread [Next in Thread>