Hey John, I don't know if you finally got your pages working.
Take a look at these. <!--- Page 1 ---> <cfquery name="GetReferences" datasource="#REQUEST.dataSource#"> SELECT * FROM reference ORDER BY topic </cfquery> <h1><strong>References</strong></h1> <cfoutput query="GetReferences" group="topic" groupcasesensitive="no"> <a href="reference_action.cfm?topics=#GetReferences.topic#">#topic#<br /><br /> </cfoutput> <!--- Page 2 (reference_action.cfm) ---> <cfparam name="URL.topics" default="1"> <cfquery name="GetTopics" datasource="#REQUEST.dataSource#"> SELECT * FROM reference WHERE topic = <cfqueryparam value="#URL.topics#" cfsqltype="CF_SQL_VARCHAR"> </cfquery> <h1><strong>Topics</strong></h1> <cfoutput query="GetTopics"> #reference# <br /> <a href="#reference_link#">#reference_link#</a> <br /> <hr> </cfoutput> -----Original Message----- From: John Barrett [mailto:[email protected]] Sent: Monday, June 13, 2011 1:44 PM To: cf-newbie Subject: Re: url params Hi, thanks so much, you code is clear to me, but when I try to run I get the error The required parameter URL.getTopic was not provided. Any thoughts on how to fix it? Thanks so much! John >See comments in code! > >Make sure you have debug mode turned on in CF Admin so you can see exactly >what is going on. > ><!--- Page 1 ---> ><cfparam name="URL.getTopic" type="string"> ><cfquery name="GetReferences" datasource="#REQUEST.dataSource#"> >SELECT * >FROM reference >ORDER BY topic ></cfquery> > ><h1><strong>References</strong></h1> ><cfoutput query="GetReferences" group="topic" groupcasesensitive="no"> ><a >href="reference_action.cfm?topics=#urlencodedformat(GetReferences.topic)#"> # >topic#<br /><br /> ><!--- examine data ---> >#urlencodedformat(GetReferences.topic)# ></cfoutput> > ><!--- Page 2 ---> > ><!--- this will show you everything in the url scope ---> ><cfdump var="#url#"> > ><!--- after this works add this code ><cfif not isdefined("url.topic")> ><cflocation url="reference1.cfm"> ></cfif> >---> > ><!--- remove the cfqueryparm for testing and fully describe the .topic in >the sql ---> > ><cfquery name="checkQuery" datasource="#REQUEST.dataSource#"> >SELECT * >FROM reference ></cfquery> > ><!--- run a check on the query and dump the results ---> ><cfdump var="#checkquery#"> > ><cfparam name="URL.getTopic" type="string"> ><cfquery name="GetReferences" datasource="#REQUEST.dataSource#"> >SELECT * >FROM reference >WHERE reference.topic = '#urlDecode(URL.getTopic)#' ></cfquery> > ><h1><strong>Topics</strong></h1> ><cfoutput query="GetReferences"> >#reference# <br /> ><a href="#reference_link#">#reference_link#</a> <br /> ><hr> ></cfoutput> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5298 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm
