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. 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 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. Link to comment https://forums.phpfreaks.com/topic/65453-simple-view-counter/#findComment-326843 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.