Brian, The main problem with that however is that i have no way of knowing when somebody visited the site so I can pick out the top ranked articles from the previous 12 hours.
Thanks, Saturday On 3 Nov 2005, at 14:39, Brian Peddle wrote: > Why does it matter if someone already viewed the article? If you > are going > to remove historical data anyway, after 14 hours, what does it > matter if the > person visited 2 hours later or 15 hours later. What about people > using > proxy servers, you may be blocking out unique views. > > I think I would axe that, add a column to the article table called > views. > Create a stored proc or query that selects the article and then > does an > update. Update article_table set views = views + 1. Or something > like > that. > > Then no need to worry about space and scheduling a delete. > > -----Original Message----- > From: Saturday (Stuart Kidd) [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 03, 2005 8:48 AM > To: CF-Talk > Subject: Finding top ranked articles > > Hi guys, > > Late last night in a matter of moments I found myself creating a > table called tbl_020articleTopRanked . The idea was to do something > similar to news stories where they display their 5 top-viewed > articles (like at SMH: http://www.smh.com.au - at the bottom end of > the page). > > So in my creation I created this table and put 4 fields there, > topRankedID (PK - incrementing), articleID (ID of the article which > has just been viewed), dateViewed (when it was viewed) and lastly > ipAddress (client's IP address). > > Each time the page gets viewed a check is made to see whether this IP > has already viewed the page in the last few hours. If they have then > an insert doesn't happen but if they haven't then a record is > inserted. > > It all works fine and I'm very happy, but i'm just trying to work out > the best way to work out what are the top viewed pages in the last 12 > hours. I also will create a script to delete, say, all inserts over > 14 hours old so that i'm not using too much MS-SQL space (this i'll > do as a CFSCHEDULE or get the hosting company to set up a schedule to > run that script. > > Any advice or help would be greatly appreciated. > > Thanks, > > Saturday > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223019 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54