4 Replies Latest reply on Apr 21, 2007 6:55 AM by Newsgroup_User

    Help Days of Error causing sleeplessness

    05madmax
      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.