• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Help Days of Error causing sleeplessness

New Here ,
Apr 20, 2007 Apr 20, 2007

Copy link to clipboard

Copied

ok so i seem to continually get an error when trying to make my drop down box options have a value that would go into the sql statement to decide which gallery to display. i am going to copy and paste my code below and the error. please help me as much as possible. also remember i am a newbie to coldfusion and the syntax to it.

Page:GalleryTypeMenu.cfm
Code:

<cfset Gallery_type1="Profiles.type='model' and 'dancer'">
<cfset Gallery_type2="Profiles.type='model'">
<cfset Gallery_type3="Profiles.type='model'">

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<cfform method="post" name="Gallery" id="Gallery" action="gallery.cfm">
<cfselect name="Gallery" id="Gallery" title="Gallery_Options">
<option id="Gallery_type1" value='variable.Gallery_type1' selected>All</option>
<option id="Gallery_type2" value='variable.Gallery_type2'>Models</option>
<option id="Gallery_type3" value='variable.Gallery_type3'>Dancers</option>
</cfselect>
<cfinput type="submit" name="Submit" value="Go">
</cfform>
</body>
</html>


Page: Gallery.cfm
Code:

<cfset Gallery_type1="Profiles.type='model' and profiles.type='dancer'">
<cfset Gallery_type2="Profiles.type='model'">
<cfset Gallery_type3="Profiles.type='model'">

<cfquery name="All_Profiles" datasource="All_Access" dbtype="dynamic">
SELECT Profiles.Last_Name, Profiles.Type, Profiles.Picture, Profiles.First_Name
FROM Profiles
WHERE <cfoutput>#form.Gallery#</cfoutput>
ORDER BY Profiles.Last_Name
</cfquery>

<html>
<head>
<title>Untitled Document</title>

</head>

<body>
<p> </p>
<table border="0" cellpadding="1" cellspacing="1" align="center">
<cfoutput query="Profiles">
<cfif profiles.currentrow mod 3 eq 1>
<tr>
</cfif>
<td>
<img src="Images/#Profiles.picture1#" width="200" height="200"><br>
<center><strong>#profiles.First_Name#<br>
#profiles.Last_Name#</strong></center>
</td>
<cfif profiles.currentrow mod 3 eq 0>
</tr>
</cfif>
</cfoutput>
</table>
</body>
</html>


Error Message (when clicking submit button):

The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.

The following information is meant for the website developer for debugging purposes.

Error Occurred While Processing Request
Error Executing Database Query.
No value given for one or more required parameters.


Resources:
Enable Robust Exception Information to provide greater detail about the source of errors. In the Administrator, click Debugging & Logging > Debugging 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 1.1.4322; .NET CLR 2.0.50727)
Remote Address 127.0.0.1
Referrer http://localhost:8500/cfide/all_access/TMP71jbrgu1if.cfm
Date/Time 20-Apr-07 11:20 PM


any help would greatly be appreciated.
TOPICS
Advanced techniques

Views

291

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 20, 2007 Apr 20, 2007

Copy link to clipboard

Copied

1) you have your form and select box named the same, "Gallery" - not a
good thing to do and can cause problems.

2) "variable" is not a cf scope. it is "variables"

3) on the gallery.cfm page your select query is wrong - specifically
your WHERE clause: a) should not have <cfoutput> tag in it; b) should
state a table field. i suspect it should be like: WHERE Profiles.type =
#form.Gallery# (where Gallery is the name of your select box, not the form)

4) you might also want to get rid of dbtype="dynamic" in the cfquery tag...

--
Azadi Saryev
Sabai-dee.com
Vientiane, Laos
http://www.sabai-dee.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 20, 2007 Apr 20, 2007

Copy link to clipboard

Copied

well i made the changes as per suggested. unfortunately i am still getting that same error of the no value given for one or more required parameters.

i removed the dynamic from the cfquery statement

removed the output tag from the where clause

changed the name of the select box to GalleryType

lastly changed the variable to variables where necessary

if you have any other suggestions i would really apprecaite it

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 21, 2007 Apr 21, 2007

Copy link to clipboard

Copied

LATEST

just noticed that your cfquery on callery.cfm page has
name="All_Profiles", but your cfoutput has query="Profiles"...

--
Azadi Saryev
Sabai-dee.com
Vientiane, Laos
http://www.sabai-dee.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 21, 2007 Apr 21, 2007

Copy link to clipboard

Copied

Two equal signs in a cfset tag is probably messing you up somewhere.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation