<cfquery name="currentHits">
    UPDATE sitecount
        SET hits = hits + 1
    WHERE id = #idpassed#
</cfquery>


Hope this helps!
Paul Giesenhagen
QuillDesign
----- Original Message -----
From: "Matthew Friedman" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, November 27, 2002 9:18 AM
Subject: SQL Question


> I have a quick SQL question:
>
> I need to keep a running count of the time a specific location is
requested
> and I could do it with 2 queries ie.
>
> <cfquery name="currentHits">
> select hits
> from sitecount
> where id = #idpassed#
> </cfquery>
>
> <cfset new_hit = currentHits.hits + 1>
>
> <cfquery name="update_currentHits">
> update sitecount
> set hits = #new_hit#
> where id = #idpassed#
> </cfquery>
>
>
> But I was wondering if you could do it in a single statment since it is an
> incremental variable.
>
> Thanks
>
> Matt
>
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to