If you want to display all the banners just leave out the MAXROWS="1"
and
each time the banners are displayed the top one will be moved to the
end and
the others will be bumped up one.
+-----------------------------------------------+
Bryan Love
Macromedia Certified Professional
Internet Application Developer
Database Analyst
Telecommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+
"...'If there must be trouble, let it be in my day, that my child may
have
peace'..."
- Thomas Paine, The American Crisis
-----Original Message-----
From: Bryan Love [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 2:13 PM
To: CF-Talk
Subject: RE: Output Question
Here is your best bet...
Most banner systems count the number of displays per banner; you can
use
this to your advantage. Right now you have to run one SELECT and one
UPDATE. Instead of just updating the displayCount column, update a
lastShown column as well with the current date. That way you can use
this
SELECT statement:
<cfquery name="foo" maxRows="1">
SELECT ...
FROM banners
ORDER BY lastShown ASC
</cfquery>
This query will grab the banner that has not been shown for the longest
amount of time.
Then run the query that updates displayCount and lastShown.
+-----------------------------------------------+
Bryan Love
Macromedia Certified Professional
Internet Application Developer
Database Analyst
Telecommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+
"...'If there must be trouble, let it be in my day, that my child may
have
peace'..."
- Thomas Paine, The American Crisis
-----Original Message-----
From: Double Down [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 1:55 PM
To: CF-Talk
Subject: Output Question
I am pulling records from a DB that display banners. I want to display
all of the banners, however I would like to rotate their display
position so the first record pulled is not always the first one
displayed. Any ideas?
DDINC
______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists