itsureboy Posted August 17, 2007 Share Posted August 17, 2007 Anyone know a simple way to count views for each product using php and a database? Each product has its own ID....... Any help? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/65453-simple-view-counter/ Share on other sites More sharing options...
MadTechie Posted August 17, 2007 Share Posted August 17, 2007 add a field and just update it by 1 per view! we will need to see some code really Quote Link to comment https://forums.phpfreaks.com/topic/65453-simple-view-counter/#findComment-326840 Share on other sites More sharing options...
l3asturd Posted August 17, 2007 Share Posted August 17, 2007 like he said, create a `views` field in your table. Set them all to 0. Now when you query the table you'll get 0 views. After the query, make $views = ($results['views']) and add value to $views using $views++. Then INSERT $views back to the table. That's how I'd attempt it. Quote Link to comment https://forums.phpfreaks.com/topic/65453-simple-view-counter/#findComment-326843 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.