Scott,

Can't go at it this way. It's more complicated than a simple hit counter but
that seemed like the simplest way to clarify what I needed. It's actually a
specialized ad banner app that I am working on right now. It needs to count
each ad impression and clickthru and increment the  count whenever a
particular ad is served or clicked. Could involve thousands of ads on
thousands of pages so I am trying to figure out the simplest method of doing
the check + increment in one step.

Thanks for any ideas.

Paul Sinclair


> -----Original Message-----
> From: Scott Weikert [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 28, 2000 4:05 PM
> To: CF-Talk
> Subject: Re: One step method to check then increment a value in db?
>
>
> If it's just a simple integer counter, why not use an application
> variable - you can just say "application.counter =
> application.counter + 1". Then set up a scheduled task to, say
> once an hour, take that application variable and update whatever
> DB field you're using. You risk losing the counts for that hour
> if by chance the server goes belly-up and requires a restart, but
> it's a lot less load on your DB server.
>
>
>
> -----Original Message-----
> From:    Paul Sinclair [EMAIL PROTECTED]
> Sent:    Thu, 28 Dec 2000 15:40:09 -0500
> To:      [EMAIL PROTECTED]
> Subject: One step method to check then increment a value in db?
>
>
> I'm looking for a simple way to check on and then increment a
> value in a db
> number field. For example, for a simple hit counter that commits hit
> information to a db field: someone hits the page; you check the
> database to
> determine the current value of hits on that page; add 1 to it; then update
> the record with the incremented value.
>
> The method above would require 2 <cfquery> actions as I see it:
> one to check
> the current value; one to update the field with the incremented value. Is
> there some way to do this without requiring 2 separate actions?
>
> Thanks for any ideas.
>
> Paul Sinclair
>
~~~~~~~~~~~~~ Paid Sponsorship ~~~~~~~~~~~~~
Get Your Own Dedicated Win2K Server!      Instant Activation for $99/month w/Free 
Setup from SoloServer      PIII600 / 128 MB RAM / 20 GB HD / 24/7/365 Tech Support     
 Visit SoloServer, https://secure.irides.com/clientsetup.cfm.

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

Reply via email to