Jump to content

Multiple page hit counter


jmcc

Recommended Posts

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

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());

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.