0 Replies - 1861 Views - Last Post: 27 January 2008 - 10:19 AM Rate Topic: -----

#1 cumupkid  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 63
  • Joined: 22-January 08

Error executing Database Query

Posted 27 January 2008 - 10:19 AM

Getting closer.

form will now upload photo but not add info to mysql.
What you were saying is what i want but didnt understand...

I have posetd the error message and highlighted in red the supposed error.


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 ')' at line 13


Resources:
Enable Robust Exception Information to provide greater detail about the source of errors. In the Administrator, click Debugging & Logging > Debug Output Settings, and select the Robust Exception Information option.
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.


Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
Remote Address 127.0.0.1
Referrer http://localhost:850...to_to_combo.cfm
Date/Time 27-Jan-08 11:59 AM







<cflock scope="Session" type="ReadOnly" timeout="30" throwontimeout="no">
<cfset MM_Username=Iif(IsDefined("Session.MM_Username"),"Session.MM_Username",DE(""))>
<cfset MM_UserAuthorization=Iif(IsDefined("Session.MM_UserAuthorization"),"Session.MM_UserAuthorization",DE(""))>
</cflock>
<cfif MM_Username EQ "">
<cfset MM_referer=CGI.SCRIPT_NAME>
<cfif CGI.QUERY_STRING NEQ "">
<cfset MM_referer=MM_referer & "?" & CGI.QUERY_STRING>
</cfif>
<cfset MM_failureURL="login.cfm?accessdenied=" & URLEncodedFormat(MM_referer)>
<cflocation url="#MM_failureURL#" addtoken="no">
</cfif>
<cfset CurrentPage=GetFileFromPath(GetBaseTemplatePath())>
<cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "upload_to_mysql">
<cfquery datasource="intheworksphotoco">
INSERT INTO photos (PHOTONAME, LARGEIMAGE, DISCRIPTION)
VALUES (<cfif IsDefined("FORM.photoname") AND #FORM.photoname# NEQ "">
<cfqueryparam value="#FORM.photoname#" cfsqltype="cf_sql_clob" maxlength="50">
<cfelse>
''
</cfif>
, <cfif IsDefined("FORM.largeimage") AND #FORM.largeimage# NEQ "">
<cfqueryparam value="#FORM.largeimage#" cfsqltype="cf_sql_clob" maxlength="30">
<cfelse>
''
</cfif>
, <cfif IsDefined("FORM.discription") AND #FORM.discription# NEQ "">
<cfqueryparam value="#FORM.discription#" cfsqltype="cf_sql_clob" maxlength="2147483647">
<cfelse>
''

</cfif>
, <cfif IsDefined("FORM.submit")><cffile accept="image/jpg,image/jpeg,image/pjpeg" action="upload" destination="C:\ColdFusion8\wwwroot\intheworksphotoco\images\" filefield="ul_path" nameconflict="error">
<cfelse>
''


</cfif>
)
</cfquery>
<cflocation url="masterphoto_list.cfm">
</cfif>
<!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">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->

<title>Upload Photo Info</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../assets/intheworks.css" type="text/css" />
</head>
<body>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="02021e">
<td colspan="4" rowspan="2" nowrap="nowrap" bgcolor="#02021E"><img src="../assets/intheworks_pg_ban.jpg" alt="Header image" width="400" height="140" border="0" /></td>
<td height="58" colspan="4" valign="bottom" nowrap="nowrap" bgcolor="#02021E" id="logo">In The Works Photo Co.</td>
</tr>
<tr bgcolor="02021E">
<td height="57" colspan="4" valign="top" nowrap="nowrap" bgcolor="#02021E" id="tagline">Photos By Independent Photographer Jermey Wilson</td>
</tr>
<tr>
<td colspan="8" bgcolor="#cc3300"><img src="../assets/intheworks_spacer.gif" alt="" width="1" height="2" border="0" /></td>
</tr>

<tr>
<td colspan="8"><img src="../assets/intheworks_spacer.gif" alt="" width="1" height="2" border="0" /></td>
</tr>

<tr>
<td colspan="8" bgcolor="#cc3300"><img src="../assets/intheworks_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>

<tr>
<td colspan="8">&nbsp;&nbsp;<br /> </td>
</tr>
<tr>
<td width="160" valign="top" height="370"><table border="0" cellspacing="0" cellpadding="0" width="155" id="navigation">
<tr>
<td width="155" height="40"><a href="../index.html">Home</a></td>
</tr>
<tr>
<td width="155" height="40"><a href="../photogallery/index.cfm">photo gallery</a></td>
</tr>
<tr>
<td width="155" height="40"><a href="../aboutme/index.html">about me</a></td>
</tr>
<tr>
<td width="155" height="40"><a href="../contactme/index.html">contact me</a></td>
</tr>
</table>
<br /></td>
<td width="2" rowspan="2" bgcolor="#445DA0"><img src="../assets/intheworks_spacer.gif" alt="" width="1" height="1" border="0" /></td>
<th height="370" colspan="5" align="left" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="40" class="pageName">Upload Photo Information</td>
</tr>
</table>
<br />
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" class="subHeader">
<tr>
<td height="40" class="subHeader">Photo Information</td>
</tr>
</table> <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form action="<cfoutput>#CurrentPage#</cfoutput>" method="POST" enctype="multipart/form-data" name="upload_to_mysql" id="upload_to_mysql">
<table width="600" border="0">
<tr>
<td width="150" height="40">Photo Name:</td>
<td width="450" height="40"><input type="text" name="photoname" id="photoname" /></td>
</tr>
<tr>
<td width="150" height="40">Phot File Name:</td>
<td width="450" height="40"><input type="text" name="largeimage" id="largeimage" /></td>
</tr>
<tr>
<td width="150" height="40"> Photo Discription:</td>
<td width="450" height="40"><input type="text" name="discription" id="discription" /></td>
</tr>
<tr>
<td height="40" align="center">&nbsp;</td>
<td height="40" align="left"><input name="ul_path" type="file" id="ul_path" size="20" /></td>
</tr>
<tr>
<td height="40">&nbsp;</td>
<td height="40"><input type="submit" name="submit" id="submit" value="Upload" />
<input type="reset" name="reset" id="reset" value="Reset" /></td>
</tr>
</table>
<input type="hidden" name="MM_InsertRecord" value="upload_to_mysql" />
</form> </td>
</tr>
</table></th>
<td width="207" valign="top"><table width="155" border="0" align="right" cellpadding="0" cellspacing="0" id="navigation2">
<tr>
<td width="155" height="40" align="right"><a href="index.cfm">Admin Home</a></td>
</tr>
<tr>
<td width="155" height="40" align="right"><a href="masterphoto_list.cfm"> Photo Info List</a></td>
</tr>
<tr>
<td width="155" height="40" align="right"><a href="insertphoto_to_file.cfm">Upload Photo</a></td>
</tr>
<tr>
<td height="40" align="right"><a href="insertphoto_to_mysql.cfm">Insert Photo Info</a></td>
</tr>
<tr>
<td height="40" align="right"><a href="logout.cfm">logout</a></td>
</tr>
</table></td>
</tr>
<tr>
<td width="160"><p><br />
</p></td>
<td width="152">&nbsp;</td>
<td width="87">&nbsp;</td>
<td width="413">&nbsp;</td>
<td width="48">&nbsp;</td>
<td width="196">&nbsp;</td>
<td width="207">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td bgcolor="#445DA0">&nbsp;</td>
<td height="10" colspan="5" align="center">This site designed &amp; maintained by <a href="mailto:jstickel56@gmail.com">Joseph Stickel</a></td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>

Is This A Good Question/Topic? 0
  • +

Page 1 of 1