> "GetAdvert" sounds like it may be a query to collect a "random" ad from a
> database?

Yes and no.  If a user runs a search for, say, "furniture," this might
retreive 15 adverts which would be using a query such as:

<cfquery name="getadvert" datasource="#DSN#">
SELECT * FROM advert_details
WHERE body like '%furniture%'
</cfquery>

Another user might be browsing the Computer's category:

<cfquery name="getadvert" datasource="#DSN#">
SELECT * FROM advert_details
WHERE cat = 156
</cfquery>

And so on.  They use the same query name, and results are obtained by
running a template which always uses <Cfoutput query="getadvert">

I like the idea of stuffing them into an Application Var to speed things up,
but is it really plausible to put 1000+ Adverts into an App Var?

Will


>
> One approach that worked very well for me was to run the query "once" and
> then store the ads in an application scoped array.  This makes retrieving
a
> "new" ad much quicker.
>
> You may want to take a look at this "Application" array here.
>
> http://cfhub.com/tutorials/BannerMan/customtag/pick.cfm
>
> On my
> > site, a query called getadvert might get a record with an ID of 1987 for
> > example.  Another user at the site might be running the same query, but
> > getting a record of 981
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to