jmcc Posted September 28, 2009 Share Posted September 28, 2009 Hi I have a property website and I would like to add the amount of times the specific property was viewed. The viewing works as follows: There is a list op properties from my db When you select a property a to view the page: detail_view.php?id="the property id" gets opened with the property displayed. How would i go about adding a hit counter to every property? I would imagine I need to add a hits field on the db for each property that gets incremented every time the property is viewed. but still kind of lost. Thanks Link to comment https://forums.phpfreaks.com/topic/175774-multiple-page-hit-counter/ Share on other sites More sharing options...
jmcc Posted September 28, 2009 Author Share Posted September 28, 2009 ok got it I created a field i my table called hits then incremented it every time someone viewed the property mysql_select_db($database_prop, $prop); $query_hits ="UPDATE seller SET seller.hits = (seller.hits + 1) WHERE id='$prop_id'"; mysql_query($query_hits, $prop) or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/175774-multiple-page-hit-counter/#findComment-926283 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.