Solved

ouput query question

Posted on 2009-05-06
2
203 Views
Last Modified: 2013-12-24
I have a shopping cart that is using an output query to display each line item.
I need to add some text to each line item if a varilable isdefined,
<cfif IsDefined("session.ccode")>
    <cfoutput><span class="text12red smallText">#GetCCode.Description#</span></cfoutput>
</cfif>
The problem is that it will repeat the output several times across the line. If I have one line item it will show once for that item.
If I have two line items it will show twice for the first one and once for the next.
If I have three lines items it will show three times for the first item, two times for the next and so on.
How do I get it to show only once for each line item?
0
Comment
Question by:usky1
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 350 total points
ID: 24316288
It is difficult to say without seeing more code. My guess would be the <cfoutput> tags.  If you already using "using an output query" that means you already have cfoutput tags around the variable.  So you do not need a second set of <cfoutput> tags around the code above.   Try removing it ...

Example:
<cfoutput query="yourQuery">
    ...
     <cfif IsDefined("session.ccode")>
         <span class="text12red smallText">#GetCCode.Description#</span>
     </cfif>
    ...
</cfoutput>
0
 

Author Closing Comment

by:usky1
ID: 31578508
Some times the obvious is missed. thanks for catching that.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question