richiejones24 Posted January 13, 2012 Share Posted January 13, 2012 Currently on my website i record the statistics, for my pages they include unique views, and total page views. at the moment every time a visitor loads a page a script updates a MySql Db. This seems very resource intensive, is there a better way to record statistics?? Quote Link to comment https://forums.phpfreaks.com/topic/254967-page-views-counter/ Share on other sites More sharing options...
The Little Guy Posted January 13, 2012 Share Posted January 13, 2012 That sounds like a reasonable approach to do it imo. Quote Link to comment https://forums.phpfreaks.com/topic/254967-page-views-counter/#findComment-1307318 Share on other sites More sharing options...
premiso Posted January 13, 2012 Share Posted January 13, 2012 Nope. Just make sure to optimize your database so it doesn't slow your site down from the queries and you should be good. There is another option, which is offloading that to something like Google Anayltics, and just let them take care of it. But if you want to be able to query it and show it to the visitors, nope there is not a better method. Quote Link to comment https://forums.phpfreaks.com/topic/254967-page-views-counter/#findComment-1307320 Share on other sites More sharing options...
SergeiSS Posted January 13, 2012 Share Posted January 13, 2012 This seems very resource intensive, is there a better way to record statistics?? 2 people answered, I'll be the 3-d men What could be another way from your point of veiw? In any case you need to save this info anywhere on a disk. In any case it will be a file! But if you use a singe file you have to care of dobble-access to a file at one time. From the other hand, if you use MySQL or any other DB, that DB is carring about it. Because DB uses files also but it controls access. In other words... Let DB to work for you. Like you do it now. "Just make sure to optimize your database" © Quote Link to comment https://forums.phpfreaks.com/topic/254967-page-views-counter/#findComment-1307329 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.