Need help with syntax for a passed parameter...

I'm an experienced programmer but I am new to ColdFusion.

I have this line in my code ...

<a href="recipe_page.cfm?varID=7"class="linktext">Medley of Brown &amp; Wild Rices</a>      

It's actually in the page recipe_page.cfm ... basically, I'm in a recipe page (which is totally dynamic) and I want to click on a link to go to another recipe. I was testing it with my recipe #7.

The "7" is available in a recordset ...  
#rs_SidesDetail.Side#

What is the proper syntax for me to replace the "7" in my line of code with the value that is in the field?
I've tried a few "obvious" syntaxes but haven't hit on the right one yet!
Thanks.
alicia1234Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

alicia1234Author Commented:
I have to expand my question:

In the line of code previously mentioned ...
<a href="recipe_page.cfm?varID=#URL.varID#" class="linktext">Medley of Brown &amp; Wild Rices</a>      
"Medley of Brown .... " is also available in a field and I need help with what to replace that text with to make it dynamic.

Here is my table setup:

tblRecipes
   RecipeID  (primary key)
   RecipeName
   ...  (other fields but they aren't relevant to this question)

tblSides
   SideID
   RecipeID
   Side

The tables are related by RecipeID

So in tblSides, "RecipeID" would be the key for me to find the RecipeName in tblRecipes.
0
wytcomCommented:
Not sure of your specifics.  

General approach is to get field values from query:
<cfquery datasource="dsRecipes" name="qryRecipes">
SELECT recipeID, recipeName FROM tblRecipes
</cfquery>

Then use these to build your page
<cfoutput query="qryRecipes">
<a href="recipe_page.cfm?varID=#qryRecipes.recipeID#" class="linktext">#qryRecipes.recipeName#</a>  
</cfoutput>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wytcomCommented:
In your action page you get the selected recipe in the url variable:

<cfset theRecipeID = url.varID>

<cfquery datasource="dsRecipes" name="qrySides">
SELECT sideID, side FROM tbleSides WHERE recipeID = #theRecipeID#>
</cfquery>

<cfoutput query="qrySides">
<div>#qrySides.side#</div>
</cfoutput>
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.