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

Problems with MySql query / CF insert

Subject: Problems with MySql query / CF insert
From: Steve Grosz
Date: Tue, 21 Aug 2007 21:24:28 -0600
Newsgroups: macromedia.coldfusion.cfml_general_discussion

Ok, I had several databases on v4.1.17 that were working fine. I wanted to upgrade to v5 to work with stored procedures and triggers a little.
I removed the instance of 4.1.17, and installed v5.

I backed up my tables using the MySql administrator. When I tried to import the back up, it failed.
I tried recreating one of the smaller tables as shown below:


CREATE TABLE `class_review` (
  `Rev_ID` bigint(20) NOT NULL auto_increment,
  `Rev_Class_Date` date NOT NULL default '0000-00-00',
  `Rev_Class_Instructor` varchar(10) NOT NULL default '',
  `Rev_Class_Knowledge` int(10) unsigned NOT NULL default '0',
  `Rev_Part` int(10) unsigned NOT NULL default '0',
  `Rev_Friend` int(10) unsigned NOT NULL default '0',
  `Rev_Prep` int(10) NOT NULL default '0',
  `Rev_Expect` int(10) unsigned NOT NULL default '0',
  `Rev_Cont` int(10) unsigned NOT NULL default '0',
  `Rev_Enjoy` int(10) unsigned NOT NULL default '0',
  `Rev_Comments` text NOT NULL,
  PRIMARY KEY  (`Rev_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

I have the following Coldfusion code that was inserting the data:
<cfquery name="AddReview" datasource="SalleBoise">
insert into class_review
(Rev_Class_Date, Rev_Class_Instructor, Rev_Knowledge, Rev_Part, Rev_Friend, Rev_Prep, Rev_Expect, Rev_Cont, Rev_Enjoy, Rev_Comments)
values
(
'#form.ClassDate#',
'#form.Instructor#',
'#form.Knowledge#',
'#form.Part#',
'#form.FR#',
'#form.Prep#',
'#form.Expect#',
'#form.Continue#',
'#form.OA#',
'#form.Comments#');
</cfquery>

But now I'm getting a message that says:

Error Executing Database Query.
Unknown column &apos;Rev_Knowledge&apos; in &apos;field list&apos;

The error occurred in C:\Inetpub\wwwroot\SalleBoise\CF\add_review.cfm: line 17
15 : '#form.Continue#',
16 : '#form.OA#',
17 : '#form.Comments#');
18 : </cfquery>
19 :



--------------------------------------------------------------------------------

SQL insert into class_review (Rev_Class_Date, Rev_Class_Instructor, Rev_Knowledge, Rev_Part, Rev_Friend, Rev_Prep, Rev_Expect, Rev_Cont, Rev_Enjoy, Rev_Comments) values ( '2006-10-23', 'Steve Grosz', '5', '5', '5', '5', '4', '4', '5', '<p>test</p>');

If anyone has any ideas on what has changed from MySql 4.1.17 to v5 and can point me in the direction I need to go, I would appreciate it!!
Thanks!
Steve

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