Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6643693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:04:48+00:00 2026-05-26T00:04:48+00:00

here is the situation, i have a table that displays some values, moreover there

  • 0

here is the situation, i have a table that displays some values, moreover there are one cfoutput inside the other, thus the currentrows are counted separately, anyway, i hope everything will be clear after source:

<cfquery name="get_products" datasource="#dsn3#">
    SELECT P.PRODUCT_ID,P.PRODUCT_NAME,PS.MONEY,PR.PRICE,P.BRAND_ID,PS.PRICE,GSL.PRODUCT_STOCK,GSL.PURCHASE_ORDER_STOCK,GSL.SALEABLE_STOCK,P.PRODUCT_DETAIL2,P.BARCOD
    FROM PRODUCT P
        JOIN PRICE_STANDART PS ON P.PRODUCT_ID = PS.PRODUCT_ID
        JOIN PRICE PR ON P.PRODUCT_ID = PR.PRODUCT_ID
        JOIN #DSN2_ALIAS#.GET_STOCK_LAST GSL ON P.PRODUCT_ID = GSL.PRODUCT_ID
        <cfif isdefined('attributes.is_stock') and attributes.is_stock is 1>
            AND GSL.PRODUCT_STOCK > 0
        </cfif>
        <cfif isdefined('attributes.product_catid') and len(attributes.product_catid)>
            JOIN PRODUCT_CAT PC ON P.PRODUCT_CATID = PC.PRODUCT_CATID
        </cfif>
    WHERE PS.PURCHASESALES=1 AND PS.PRICESTANDART_STATUS=1 AND P.IS_SALES=1 AND P.IS_PURCHASE=1 AND P.IS_INTERNET=1 AND P.IS_EXTRANET=1
    AND PR.STARTDATE <= #now()# AND (PR.FINISHDATE >= #now()# OR PR.FINISHDATE IS NULL)

    GROUP BY P.PRODUCT_ID,PR.PRICE,P.PRODUCT_NAME,PS.MONEY,P.BRAND_ID,PS.PRICE,GSL.PRODUCT_STOCK,GSL.PURCHASE_ORDER_STOCK,GSL.SALEABLE_STOCK,P.PRODUCT_DETAIL2,P.BARCOD
    P.PRODUCT_ID, PR.PRICE DESC
</cfquery>

then table:

<cfoutput query="get_products" startrow="#attributes.startrow#" maxrows="#attributes.maxrows#" group="product_id">
        <tr height="20" onMouseOver="this.className='color-light';" onMouseOut="this.className='color-row';" class="color-row"> 
            <td>
                <a href="/index.cfm?fuseaction=product.form_upd_product&pid=#product_id#" style="color:blue;" target="_blank">#left(product_name,50)#</a>
            </td>
            <td>#left(PRODUCT_DETAIL2,50)#</td>
            <td align="center"><cfif len(brand_list)>#get_brands.brand_name[listfind(brand_list,brand_id,',')]#</cfif></td>
            <td align="center">#PRODUCT_STOCK#</td>
            <td align="center">#saleable_stock#</td>
            <td align="center">#purchase_order_stock#</td>
            <cfoutput><td align="center">#tlformat(price,2)# <cfif currentrow eq 4>asd</cfif></td></cfoutput>
            <td align="center"><a href="javascript://" onclick="gizle_goster(abr#currentrow#);" style="font-weight:bold;">x #saleable_stock#</a></td>
            <td align="center">#MONEY#</td>
        </tr>
        <tr onMouseOver="this.className='color-light';" onMouseOut="this.className='color-row';" class="color-row" id="abr#currentrow#" style="display:none;">
            <td colspan="3"></td>
            <td colspan="3" style="color:blue;font-weight:bold;text-align:center;">#saleable_stock# x</td>
            <cfoutput>
                <td align="center" style="color:red;font-weight:bold;text-align:center;">#tlformat((saleable_stock*price),2)#</td>
                <cfset abr = tlformat((saleable_stock*price),2)>
            </cfoutput>
            <td align="center" colspan="2">#MONEY#</td>
        </tr>
    </cfoutput>

and the result:
http://s008.radikal.ru/i303/1110/2a/031496096958.png

as you can see writing “asd” is only displayed in the first row of the outside cfoutput, but in the 4th row of the inside cfoutput. ( there are 4 prices in one row )
All i want is to write the “asd” in every row of the outside cfoutput, and in the 4th row of the inside row.

Thank you all for the help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:04:48+00:00Added an answer on May 26, 2026 at 12:04 am

    When you do a grouped output, the CURRENTROW var of a CFQUERY doesn’t behave like you would think.

    The quickest solution would be to set and increment a new variable within your grouped output, here:

    <cfset iter = 1 />
    <cfoutput><td align="center">#tlformat(price,2)# <cfif iter eq 4>asd</cfif></td><cfset iter++ /></cfoutput>
    

    Be sure to reset the var at the start of any new grouped output (so duplicate this code in your second <TR> row as well).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my situation: I have one table that contains a list of drugs
Here's the situation: We have some generic graphics code that we use for one
Here's the situation I'm in. I have a table containing peoples' information. Some of
Okay, here's the situation: We have a table of about 50 columns (created by
So here's my situation. I have a books table and authors table. An author
Here is my situation: I have an application that use a configuration file. The
I have a situation where I have a table that has a soft foreign
The Situation I have a table in a DB that contains job types, basically
Here is situation I have been trying to solve Lets take a Employee table
So here is the situation - I have a store app that I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.