View Full Version : Multiple page hit counter

09-28-2009, 09:01 AM

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.


09-28-2009, 09:09 AM

Get yourself on to google analytics, you can find out how many hits per page, which browsers, operating systems, trends and you can schedule yourself report via email.

You can possible get this data from Awstats and then import this into a database.

I am possible not helping but i love google analytics.

09-28-2009, 09:56 AM
thank you for the advice, but think i got it.

i created a field in table called hits in my seller table then incremented it every time someone clicked on that 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());

09-29-2009, 12:49 AM
nice one , google analytics is pretty good for this though