Error Executing Database Query.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order, place, compID)
VALUES ('test', 'karma', '1', 'place', 'compID')' at line 1
The error occurred in D:/home/rappinlounge.com/wwwroot/post/post_banner.cfm: line 23
21 :
22 :
23 : <cfquery datasource="#dsn#" name="insert">
24 : INSERT INTO banners (url, image, order, place, compID)
25 : VALUES ('test', 'karma', '1', 'place', 'compID')
I have no idea what I did wrong. Been at it all day any help
here is my code:
This is my process part.
<cfset UploadFolder="#ExpandPath( '..\images\banners\' )#">
<cfparam default="false" name="edit">
<cfparam default="null" name="tags">
<cfoutput>
<cfif DirectoryExists(UploadFolder)>
<cfif IsDefined("Form.UploadFile") AND Form.UploadFile NEQ "">
<cffile
action="upload"
filefield="UploadFile"
destination="#UploadFolder#"
nameconflict="overwrite"
accept="image/*"
>
File uploaded successfully!
<br />
Uploaded file: #cffile.ClientFile#
<cfquery datasource="#dsn#">
INSERT INTO banners (url, image, order, place, compID)
VALUES ('test', 'karma', '1', 'place', 'compID')
</cfquery>
Your Post Has been successful
<cfelse>
Select a file first!
</cfif>
<cfelse>
Upload Directory not exists
</cfif>
</cfoutput>
The form code:
<script language="Javascript" type="text/javascript" src="wysiwyg.js">
</script>
<cfif session.logged_in eq 0>
<cflocation url="../index.cfm" addtoken="no">
</cfif>
<cfif session.user_level neq 'admin'>
<cflocation url="../index.cfm" addtoken="no">
</cfif>
<cfparam default="0" name="perid">
<cfparam default="false" name="edit">
<cfif perid NEQ 0>
<cfset edit = 'true'></cfif>
<cfoutput>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Post</title>
</head>
<body>
<form method="post" enctype="multipart/form-data" action="post_banner.cfm">
<table>
<tr><td width="167">CompID</td><td width="336"><input type="text" name="compID" /></td></tr>
<tr><td>Please upload an image: </td><td><input type="file" name="UploadFile"></td></tr>
<tr><td>Url:</td><td>
<input name="url" type="text" />
<tr><td></td>
<tr><td><input type="hidden" name="place" value="home" />
<input type="hidden" name="order" value="1" />
</td><td align="right"><input type="submit" value="POST" /></td></tr>
</table>
</form>
</body>
</html>
</cfoutput>

New Topic/Question
Reply




MultiQuote




|