Solved

ouput query question

Posted on 2009-05-06
2
178 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 …
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now