slight correction - i had a redundancy - you dont need "maxrows="1" as
well as SELECT top 1   so the query would be better written as

<CFQUERY DATASOURCE="#Green#" NAME="GetADs">
 SELECT top 1 *
 FROM dbo.banner_left
<!---- if you want to add some restrictions like for example only
select from the ones that havent been displayed recently ----- >
WHERE lastdisplay <    'whatever'
ORDER BY newID()
</CFQUERY>

That way you're suing SQLServer's inbuilt randomiser,  doing the whole
thing in a single query.   I use this all over the place.  I have some
sites where i have a random image displayed in teh header,  and a
couple of others where i have a random quotablequote displayed,
another where i have a random joke appear.   All use this same
technique and it's quick as a flash and rock solid.     All you have
is a query,   with a single record, then you have ColdFusion display
it.  That's all there is to it.
-- 
Cheers
Mike Kear
Windsor, NSW, Australia
Adobe Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316233
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to