If each one of your pages is dynamic, like buscard.cfm?client=2 In your database, in the client table, you could add a column named hit_counter with a default of 1
Then just add 1 to it each time the page is viewed. Update clients SET hit_counter = hit_counter + 1 Or if you want it tracked by business card, in your business card table you could do the same thing. You could even add a hit_ip column to it, and store the last persons IP in it, this way if a person hits refresh over and over it won't go up. Update clients SET hit_counter = hit_counter + 1 WHERE #cgi.remote_addr# <> hit_ip ______________________ steve oliver cresco technologies, inc. http://www.crescotech.com -----Original Message----- From: C. Hatton Humphrey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 22, 2002 8:48 AM To: CF-Talk Subject: RE: Hits counter at DB? (II) Okay, going on that there are a couple of questions to ask in return. What kind of data source is this running on? Is it running on a dedicated machine or on something that is sharing resources? As far as the "business cards", where do they come from? Are they stored in the database or are they static pages that are being called? Counters can be done any number of ways. The easiest would be to do an update or a locked update statement. Another way would be to create a table that was a "counter" table that you inserted into versus updating. The "report" would then be along the lines of "select count(page_id) as hit_count from counter where page_id = whatever" instead of "select hit_count from counter". Another idea, a hybrid of the two I just mentioned, would be to have a temp table that a hit would insert into and then a second table that head totals that were calculated nightly by a scheduled process. Hope these give you some food for thought. Hatton > > Our website is composed by a huge number of "business cards". We > > want to show to our clients their "card" statistics with pretty > > interface. > Something > > like: hits by day, hits in the last month, average, etc. The first > > thing > we > > thought was to make an "UPDATE Counter = Counter + 1" query > each time the > > webuser hits each webpage. But We are thinking this can be > dangerous cause > > we have more than 1000 000 hits in a month and growing. > > > > We can't give access to a statistics software. > > > > May we use and text file instead? What do you recommend? > > > > Thanks in advance, ______________________________________________________________________ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists