At 08:19 AM 7/6/00 -0400, you wrote:
>I'm setting up a real simple auction application. Super simple. People
>
>submit bids via a form, then the top 5 bids are displayed on a page. The
>
>catch is, I only want the 5th highest bid to show the actual bid.
>
>So, I can order the query by bid descending and for output bids 1 through 5
>
>will give the bidders name, but I need to have the bid amounts hidden for
>
>the top 4 bids, and show the 5th.
>
>To display only the top 5 bids, I'm using maxrows =5 in my output. Is there
>
>a way to control all this stuff with the SQL, or do I have a basic query,
>
>order by bid desc. and control the results through output?
>
>With the output method, I can't seem to be able to get the results to
>
>populate the 5th bid amt., but not the first 4.

Ok, in your output, use cfloop instead of cfoutput. Loop through the query 
and use a counter in the loop (if you need more info on this, let me know, 
but it's pretty basic, so I'll assume you can figure it out). When the 
counter is 5, you will change the information that is sent to the browser. 
So you'd do something like this (I don't guarantee the code because I'm not 
testing it):

<cfset i=1>
<cfloop query="yourqueryname">
         <cfif i LT 5>
         #bidder#        #biddercontact#
         <cfelse>
         #bidder#        #biddercontact#         #bid#
         </cfif>
</cfloop>
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to