<cfquery name="gethits" datasource="hit_count" dbtype="ODBC">
SELECT hit_count
FROM hitcounter
</cfquery>
<cfif gethits.recordcount IS 0>
<cfquery name="inserthit" datasource="hit_count" dbtype="ODBC">
INSERT INTO hitcounter (hit_count)
VALUES (1)
</cfquery>
<cfelse>
<cfquery name="updatehits" datasource="hit_count" dbtype="ODBC"
username="webupdate" password="webupdate">
UPDATE hitcounter
SET hit_count = hit_count + 1
</cfquery>
<table align="center">
<tr>
<td><b>No. of viewers: </b>
<cfoutput query="gethits">
<font size="+2" color="green">#hit_count#</font></cfoutput></td></tr>
</cfif>
-----Original Message-----
From: Jon Hall [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 12, 2001 5:21 PM
To: CF-Talk
Subject: Counter tag
Can someone reccommend a decent counter tag that produces images and uses a
database? I think bringing another counter tag into this world would be
quite redundant...
jon
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists