Solved

ouput query question

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Remove Index.php in Codeigniter 12 71
Reverse Proxy Server 6 96
Tool to email me when a website changes 29 137
PHP in Apache server 20 104
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…
What You Need to Know when Searching for a Webhost Provider
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

685 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